diff --git a/data/sprites/kangaroo.png b/data/sprites/kangaroo.png new file mode 100644 index 0000000..5c657ad Binary files /dev/null and b/data/sprites/kangaroo.png differ diff --git a/defs.h b/defs.h index 53d8292..4e5c1a1 100644 --- a/defs.h +++ b/defs.h @@ -380,7 +380,7 @@ #define S_SLOPE 2 // Sprite types -#define MAXPTYPES 148 +#define MAXPTYPES 149 #define P_PLAYER 0 #define P_RAT 1 #define P_CHEESE 2 @@ -534,6 +534,7 @@ #define P_SMALLANCHOR 145 #define P_MAGNET 146 #define P_BADMAGNET 147 +#define P_KANGAROO 148 #define FLY_FLYTIME 150 @@ -596,6 +597,7 @@ #define PW_ANCHOR 16 // anchor #define PW_MAGNET 17 // magnet #define PW_BADMAGNET 18 // badmagnet +#define PW_KANGAROO 19 // kangaroo // "virtual" powerup for bosses #define PW_RATSHAKE 20 // shake screen horizontally #define PW_SNAILSHAKE 21 // shake screen vertically diff --git a/rc.c b/rc.c index 09bc3b6..db0fb64 100644 --- a/rc.c +++ b/rc.c @@ -1421,6 +1421,8 @@ void jump(sprite_t *s, int dir) { s->jumping = 1; if (s->climbing) { s->jumpspeed = 3; + } else if (s->powerup == PW_KANGAROO) { + s->jumpspeed = 7; } else if (s->ontramp) { s->jumpspeed = 7; } else { @@ -1451,7 +1453,7 @@ void jump(sprite_t *s, int dir) { s->recoiling = B_FALSE; } else { // play sound effect - if (s->ontramp) { + if ((s->ontramp) || (s->powerup == PW_KANGAROO)) { playfx(FX_SPRING); } else { playfx(FX_JUMP); @@ -7321,6 +7323,12 @@ int dofruiteffect(sprite_t *pp, sprite_t *s) { addoutlinetext(s->x,s->y - s->img->h/2, TEXTSIZE_POINTS, tempm,&white,&black,POINTSDELAY, TT_NORM); pp->powerup = PW_MAGNET; return B_TRUE; + } else if (s->id == P_KANGAROO) { + playfx(FX_POWERUP); + sprintf(tempm, "Kangaroo jumps!"); + addoutlinetext(s->x,s->y - s->img->h/2, TEXTSIZE_POINTS, tempm,&white,&black,POINTSDELAY, TT_NORM); + pp->powerup = PW_KANGAROO; + return B_TRUE; } else if (s->id == P_BADMAGNET) { playfx(FX_SKULL); sprintf(tempm, "Repel fruits!"); diff --git a/shared.c b/shared.c index cb98381..6390627 100644 --- a/shared.c +++ b/shared.c @@ -1559,6 +1559,9 @@ int loadimagesets(void) { loadspriteimage(P_BADMAGNET,F_WALK1, "sprites/badmagnet.png"); imageset[P_BADMAGNET].numimages = 1; + loadspriteimage(P_KANGAROO,F_WALK1, "sprites/kangaroo.png"); + imageset[P_KANGAROO].numimages = 1; + loadspriteimage(P_ZAPPOWERUP,F_WALK1, "sprites/zapper.png"); imageset[P_ZAPPOWERUP].numimages = 1; @@ -2454,6 +2457,7 @@ int isfruit(int id) { case P_RANDOM: case P_MAGNET: case P_BADMAGNET: + case P_KANGAROO: return FT_TEMP; /* flowers */ case P_FLOWERYELLOW: @@ -3097,7 +3101,7 @@ int loadlevellist(void) { int randompowerup(void) { int num; - num = rand() % 41; + num = rand() % 42; switch (num) { case 0: @@ -3188,6 +3192,8 @@ int randompowerup(void) { return P_MAGNET; case 40: return P_BADMAGNET; + case 41: + return P_KANGAROO; } } @@ -3338,6 +3344,7 @@ void setfruitinfo(void) { setinfo(P_ANCHOR, "Anchor", "The extremely heavy anchor will weigh down enemies, preventing them from jumping or flying.", "anchor.png"); setinfo(P_MAGNET, "Magnet", "Collecting this powerup will align the magnetic forces of the earth in your favour, attracting all nearby fruits towards you.", "magnet.png"); setinfo(P_BADMAGNET, "Red Skull", "This skull curses you and will repel fruits away from you, denying you access to them!", "badmagnet.png"); + setinfo(P_KANGAROO, "Kangaroo", "For the remainder of the current level, your jumping ability is increased to that of a kangaroo!", "kangaroo.png"); setinfo(P_ZAPPOWERUP, "Bug Zapper", "Zaps nearby enemies with miniature bolts of lightning", "zapper.png"); setinfo(P_SKULL, "Green Skull", "Avoid these at all costs! The green skull will cause you to lose all net powerups.", "skull.png"); setinfo(P_CLOVER, "4-Leaf Clover", "Increases your luck...", "clover.png"); diff --git a/website/info.html b/website/info.html index 5ba54d3..39382c3 100644 --- a/website/info.html +++ b/website/info.html @@ -29,7 +29,7 @@