- Added new powerup: gnome

- Redrew explosion sprite
This commit is contained in:
Rob Pearce 2008-11-16 21:24:00 +00:00
parent 155a280bcf
commit a18947cc7a
14 changed files with 75 additions and 7 deletions

BIN
data/sounds/boom2.wav Normal file

Binary file not shown.

BIN
data/sprites/exp0.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 303 B

BIN
data/sprites/exp1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 447 B

BIN
data/sprites/exp2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
data/sprites/exp3.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
data/sprites/exp4.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 551 B

BIN
data/sprites/exp5.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 430 B

BIN
data/sprites/exp6.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 275 B

BIN
data/sprites/gnome.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1021 B

9
defs.h
View File

@ -26,6 +26,9 @@
#define PUFFSPEED 4 // how fast it animates (smaller = faster) #define PUFFSPEED 4 // how fast it animates (smaller = faster)
#define PUFFAPPEAR 4 // frame at which puff will turn into a gem #define PUFFAPPEAR 4 // frame at which puff will turn into a gem
// explosion
#define EXPFRAMES 7
// shuriken // shuriken
#define STARFRAMES 5 #define STARFRAMES 5
#define STARSPEED 3 #define STARSPEED 3
@ -249,7 +252,7 @@
/* enums */ /* enums */
/* sounds */ /* sounds */
#define MAXFX 50 #define MAXFX 51
#define FX_SHOOT 0 #define FX_SHOOT 0
#define FX_SLAM 1 #define FX_SLAM 1
#define FX_KILL 2 #define FX_KILL 2
@ -300,6 +303,7 @@
#define FX_ZAP 47 #define FX_ZAP 47
#define FX_SNAILPREPARE 48 #define FX_SNAILPREPARE 48
#define FX_WHOOSH 49 #define FX_WHOOSH 49
#define FX_BOOM2 50
// card suits // card suits
#define CS_HEART 1 #define CS_HEART 1
@ -325,7 +329,7 @@
#define S_SLOPE 2 #define S_SLOPE 2
// Sprite types // Sprite types
#define MAXPTYPES 136 #define MAXPTYPES 137
#define P_PLAYER 0 #define P_PLAYER 0
#define P_RAT 1 #define P_RAT 1
#define P_CHEESE 2 #define P_CHEESE 2
@ -467,6 +471,7 @@
#define P_FLY 133 #define P_FLY 133
#define P_PLAYER2 134 #define P_PLAYER2 134
#define P_ARMOUR2 135 // player 2 wearing armour #define P_ARMOUR2 135 // player 2 wearing armour
#define P_GNOME 136
#define FLY_FLYTIME 150 #define FLY_FLYTIME 150

52
rc.c
View File

@ -2224,7 +2224,40 @@ int movesprite(sprite_t *s) {
s->dir = -s->dir; s->dir = -s->dir;
} }
} }
} else if ((s->id == P_PUFF) || (s->id == P_SMASH) || (s->id == P_SPARKLE)) { } else if (s->id == P_SMASH) {
// still delaying
if (s->timer1 < 0) {
// increment "frame"
s->timer1++;
} else {
// increment frame at a slower pace
if (++s->timer2 >= 10) {
s->timer2 = 0;
}
if (timer % PUFFSPEED == 0) {
s->timer1++;
// finished animating
if (s->timer1 == imageset[s->id].numimages) {
s->timer1 = 999; // for debugging
s->dead = D_FINAL;
}
}
}
} else if (s->id == P_MOVINGCARD) {
// timer1 is the actual cardid
// timer2 is the target x position
// timer3 is the target y position
//
// move towards end position
moveto(s, s->timer2, s->timer3, CARDSPEED, CARDSPEED);
// are we there yet?
if ((s->x == s->timer2) && (s->y == s->timer3)) {
gaincard(s->owner, s->timer1);
s->dead = D_FINAL;
}
} else if ((s->id == P_PUFF) || (s->id == P_SPARKLE)) {
/* SUMMARY: /* SUMMARY:
timer1: timer1:
indicates current frame. if < 0, don't draw. indicates current frame. if < 0, don't draw.
@ -6859,6 +6892,22 @@ int dofruiteffect(sprite_t *pp, sprite_t *s) {
gunorigx[1] = player2->x; gunorigx[1] = player2->x;
gunorigy[1] = player2->y; gunorigy[1] = player2->y;
} }
return B_TRUE;
} else if (s->id == P_GNOME) {
sprite_t *s2;
playfx(FX_BOOM2);
sprintf(tempm, "Exploding Flowers!");
addoutlinetext(s->x,s->y - s->img->h/2, TEXTSIZE_POINTS, tempm,&white,&black,POINTSDELAY, TT_NORM);
puffin(-1, s->x, s->y, "gnomepuff", 0);
// turn all flowers into explosions
for (s2 = sprite; s2 ; s2 = s2->next) {
if (isflower(s2->id)) {
// replace with an explosion
s2->dead = D_FINAL;
addsprite(P_SMASH, s2->x, s2->y, "gnom_exp");
}
}
return B_TRUE; return B_TRUE;
} else if (s->id == P_ZAPPOWERUP) { } else if (s->id == P_ZAPPOWERUP) {
sprite_t *newsp; sprite_t *newsp;
@ -7079,6 +7128,7 @@ int initsound(void) {
loadfx(FX_ZAP, "zap.wav"); loadfx(FX_ZAP, "zap.wav");
loadfx(FX_SNAILPREPARE, "longdrum.wav"); loadfx(FX_SNAILPREPARE, "longdrum.wav");
loadfx(FX_WHOOSH, "whoosh.wav"); loadfx(FX_WHOOSH, "whoosh.wav");
loadfx(FX_BOOM2, "boom2.wav");
// load sound effects // load sound effects
for (i = 0; i < MAXFX; i++) { for (i = 0; i < MAXFX; i++) {

View File

@ -1489,6 +1489,9 @@ int loadimagesets(void) {
loadspriteimage(P_GUN,F_WALK1, "sprites/gunner.png"); loadspriteimage(P_GUN,F_WALK1, "sprites/gunner.png");
imageset[P_GUN].numimages = 1; imageset[P_GUN].numimages = 1;
loadspriteimage(P_GNOME,F_WALK1, "sprites/gnome.png");
imageset[P_GNOME].numimages = 1;
loadspriteimage(P_ZAPPOWERUP,F_WALK1, "sprites/zapper.png"); loadspriteimage(P_ZAPPOWERUP,F_WALK1, "sprites/zapper.png");
imageset[P_ZAPPOWERUP].numimages = 1; imageset[P_ZAPPOWERUP].numimages = 1;
@ -1538,11 +1541,16 @@ int loadimagesets(void) {
char name[SMALLBUFLEN]; char name[SMALLBUFLEN];
sprintf(name, "sprites/puff%d.png",i); sprintf(name, "sprites/puff%d.png",i);
loadspriteimage(P_PUFF,i, name); loadspriteimage(P_PUFF,i, name);
sprintf(name, "sprites/puff%d.png",i);
loadspriteimage(P_SMASH,i, name);
} }
imageset[P_PUFF].numimages = PUFFFRAMES; imageset[P_PUFF].numimages = PUFFFRAMES;
imageset[P_SMASH].numimages = PUFFFRAMES;
for (i = 0; i < EXPFRAMES; i++) {
char name[SMALLBUFLEN];
sprintf(name, "sprites/exp%d.png",i);
loadspriteimage(P_SMASH,i, name);
}
imageset[P_SMASH].numimages = EXPFRAMES;
// playing card bonuses // playing card bonuses
//loadspriteimage(P_CARDHK,F_WALK1, "sprites/cardhk.png"); //loadspriteimage(P_CARDHK,F_WALK1, "sprites/cardhk.png");
@ -2327,6 +2335,7 @@ int isfruit(int id) {
case P_GUN: case P_GUN:
case P_ZAPPOWERUP: case P_ZAPPOWERUP:
case P_SKULL: case P_SKULL:
case P_GNOME:
case P_RANDOM: case P_RANDOM:
return FT_TEMP; return FT_TEMP;
/* flowers */ /* flowers */
@ -2958,7 +2967,7 @@ int loadlevellist(void) {
int randompowerup(void) { int randompowerup(void) {
int num; int num;
num = rand() % 34; num = rand() % 35;
switch (num) { switch (num) {
case 0: case 0:
@ -3035,6 +3044,8 @@ int randompowerup(void) {
return P_ZAPPOWERUP; return P_ZAPPOWERUP;
case 33: case 33:
return P_RANDOM; return P_RANDOM;
case 34:
return P_GNOME;
} }
} }
@ -3172,6 +3183,7 @@ void setfruitinfo(void) {
setinfo(P_TAP, "Tap", "The leaky tap will flood the level with water for 20 seconds, allowing you to access hard to reach areas.", "tap.png"); setinfo(P_TAP, "Tap", "The leaky tap will flood the level with water for 20 seconds, allowing you to access hard to reach areas.", "tap.png");
setinfo(P_ACCORDION, "Accordion", "Makes your nets enormous", "accordion.png"); setinfo(P_ACCORDION, "Accordion", "Makes your nets enormous", "accordion.png");
setinfo(P_GUN, "Gunner", "Temporarily equips you with a super powerful machine gun!", "gunner.png"); setinfo(P_GUN, "Gunner", "Temporarily equips you with a super powerful machine gun!", "gunner.png");
setinfo(P_GNOME, "Garden Gnome", "This tricky little gnome has rigged explosive devices to all flowers on the level - when collected he will detonate them!", "gnome.png");
setinfo(P_ZAPPOWERUP, "Bug Zapper", "Zaps nearby enemies with miniature bolts of lightning", "zapper.png"); setinfo(P_ZAPPOWERUP, "Bug Zapper", "Zaps nearby enemies with miniature bolts of lightning", "zapper.png");
setinfo(P_SKULL, "Skull", "Avoid these at all costs! The skull will cause you to lose all net powerups.", "skull.png"); setinfo(P_SKULL, "Skull", "Avoid these at all costs! The skull will cause you to lose all net powerups.", "skull.png");
setinfo(P_CLOVER, "4-Leaf Clover", "Increases your luck...", "clover.png"); setinfo(P_CLOVER, "4-Leaf Clover", "Increases your luck...", "clover.png");

BIN
website/img/gnome.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

@ -70,6 +70,7 @@
<tr><td align=center><img src="img/gunner.png"><br>Gunner</td><td>Temporarily equips you with a super powerful machine gun!</td></tr> <tr><td align=center><img src="img/gunner.png"><br>Gunner</td><td>Temporarily equips you with a super powerful machine gun!</td></tr>
<tr><td align=center><img src="img/zapper.png"><br>Bug Zapper</td><td>Zaps nearby enemies with miniature bolts of lightning</td></tr> <tr><td align=center><img src="img/zapper.png"><br>Bug Zapper</td><td>Zaps nearby enemies with miniature bolts of lightning</td></tr>
<tr><td align=center><font color="ff00ff"><b><big>?</big></b></font><br>Random</td><td>Gives you a random effect...</td></tr> <tr><td align=center><font color="ff00ff"><b><big>?</big></b></font><br>Random</td><td>Gives you a random effect...</td></tr>
<tr><td align=center><img src="img/gnome.png"><br>Garden Gnome</td><td>This tricky little gnome has rigged explosive devices to all flowers on the level - when collected he will detonate them!</td></tr>
<tr bgcolor="#ffff00"><th colspan=2>Super Powerups</th></tr> <tr bgcolor="#ffff00"><th colspan=2>Super Powerups</th></tr>
<tr><td align=center><img src="img/bigspeed.png"><br>Big Speed Up</td><td>Makes you walk faster, permenantly!</td></tr> <tr><td align=center><img src="img/bigspeed.png"><br>Big Speed Up</td><td>Makes you walk faster, permenantly!</td></tr>
<tr><td align=center><img src="img/bigscuba.png"><br>Big Scuba Mask</td><td>Permenantly gives you fast underwater movement.</td></tr> <tr><td align=center><img src="img/bigscuba.png"><br>Big Scuba Mask</td><td>Permenantly gives you fast underwater movement.</td></tr>