Tweaked delay of moth shooting

Added extra frames for moth bullet
This commit is contained in:
Rob Pearce 2009-03-20 01:47:56 +00:00
parent bbb53f6304
commit 227f1c219e
9 changed files with 25 additions and 8 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 674 B

After

Width:  |  Height:  |  Size: 631 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 686 B

After

Width:  |  Height:  |  Size: 645 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 687 B

After

Width:  |  Height:  |  Size: 674 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 694 B

After

Width:  |  Height:  |  Size: 686 B

BIN
data/sprites/mothfire4.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 687 B

BIN
data/sprites/mothfire5.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 694 B

2
defs.h
View File

@ -290,7 +290,7 @@
// moth
#define MOTH_PAUSE 20
#define MOTH_FIRESPACE 5 // space between shots
#define MOTH_FIRESPACE 3 // space between shots
// moth states
#define MS_FLY 0
#define MS_PAUSE1 1

9
rc.c
View File

@ -5142,6 +5142,7 @@ int movesprite(sprite_t *s) {
ss = addsprite(P_MOTHFIRE,s->x,s->y - s->img->h/2,"mothfire" );
ss->xs = cos(ang) * getspeed(ss);
ss->ys = sin(ang) * getspeed(ss);
ss->timer1 = 0;
}
}
if (s->timer3 == 0) {
@ -5758,6 +5759,14 @@ int movesprite(sprite_t *s) {
s->dead = D_FINAL;
}
} else if (s->id == P_MOTHFIRE) {
// timer1 = frame
// update frame
if ((timer % 5) == 0) {
s->timer1++;
if (s->timer1 >= imageset[P_MOTHFIRE].numimages) {
s->timer1 = 0;
}
}
// move
s->x += s->xs;
s->y += s->ys;

View File

@ -1953,9 +1953,13 @@ int loadimagesets(void) {
loadspriteimage(P_MOTHFIRE,1, "sprites/mothfire1.png");
loadspriteimage(P_MOTHFIRE,2, "sprites/mothfire2.png");
loadspriteimage(P_MOTHFIRE,3, "sprites/mothfire3.png");
loadspriteimage(P_MOTHFIRE,4, "sprites/mothfire2.png");
loadspriteimage(P_MOTHFIRE,5, "sprites/mothfire1.png");
imageset[P_MOTHFIRE].numimages = 6;
loadspriteimage(P_MOTHFIRE,4, "sprites/mothfire4.png");
loadspriteimage(P_MOTHFIRE,5, "sprites/mothfire5.png");
loadspriteimage(P_MOTHFIRE,6, "sprites/mothfire4.png");
loadspriteimage(P_MOTHFIRE,7, "sprites/mothfire3.png");
loadspriteimage(P_MOTHFIRE,8, "sprites/mothfire2.png");
loadspriteimage(P_MOTHFIRE,9, "sprites/mothfire1.png");
imageset[P_MOTHFIRE].numimages = 10;
// manual angry image for black cloud
@ -2118,11 +2122,15 @@ void drawsprite(sprite_t *s) {
if (isfruit(s->id)) {
frame = F_WALK1;
} else if (isbullet(s->id)) {
if (s->id == P_MOTHFIRE) {
frame = s->timer1;
} else {
if ((timer/6) % 2 == 0) {
frame = F_WALK1;
} else {
frame = F_JUMP;
}
}
} else if (iseffect(s->id)) {
if ((s->id == P_PUFF) || (s->id == P_SMASH) || (s->id == P_SPARKLE) || (s->id == P_FLAME) ) {
if (s->timer1 >= imageset[s->id].numimages) {