Tweaked delay of moth shooting
Added extra frames for moth bullet
Before Width: | Height: | Size: 674 B After Width: | Height: | Size: 631 B |
Before Width: | Height: | Size: 686 B After Width: | Height: | Size: 645 B |
Before Width: | Height: | Size: 687 B After Width: | Height: | Size: 674 B |
Before Width: | Height: | Size: 694 B After Width: | Height: | Size: 686 B |
After Width: | Height: | Size: 687 B |
After Width: | Height: | Size: 694 B |
2
defs.h
|
@ -290,7 +290,7 @@
|
||||||
|
|
||||||
// moth
|
// moth
|
||||||
#define MOTH_PAUSE 20
|
#define MOTH_PAUSE 20
|
||||||
#define MOTH_FIRESPACE 5 // space between shots
|
#define MOTH_FIRESPACE 3 // space between shots
|
||||||
// moth states
|
// moth states
|
||||||
#define MS_FLY 0
|
#define MS_FLY 0
|
||||||
#define MS_PAUSE1 1
|
#define MS_PAUSE1 1
|
||||||
|
|
9
rc.c
|
@ -5142,6 +5142,7 @@ int movesprite(sprite_t *s) {
|
||||||
ss = addsprite(P_MOTHFIRE,s->x,s->y - s->img->h/2,"mothfire" );
|
ss = addsprite(P_MOTHFIRE,s->x,s->y - s->img->h/2,"mothfire" );
|
||||||
ss->xs = cos(ang) * getspeed(ss);
|
ss->xs = cos(ang) * getspeed(ss);
|
||||||
ss->ys = sin(ang) * getspeed(ss);
|
ss->ys = sin(ang) * getspeed(ss);
|
||||||
|
ss->timer1 = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (s->timer3 == 0) {
|
if (s->timer3 == 0) {
|
||||||
|
@ -5758,6 +5759,14 @@ int movesprite(sprite_t *s) {
|
||||||
s->dead = D_FINAL;
|
s->dead = D_FINAL;
|
||||||
}
|
}
|
||||||
} else if (s->id == P_MOTHFIRE) {
|
} 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
|
// move
|
||||||
s->x += s->xs;
|
s->x += s->xs;
|
||||||
s->y += s->ys;
|
s->y += s->ys;
|
||||||
|
|
14
shared.c
|
@ -1953,9 +1953,13 @@ int loadimagesets(void) {
|
||||||
loadspriteimage(P_MOTHFIRE,1, "sprites/mothfire1.png");
|
loadspriteimage(P_MOTHFIRE,1, "sprites/mothfire1.png");
|
||||||
loadspriteimage(P_MOTHFIRE,2, "sprites/mothfire2.png");
|
loadspriteimage(P_MOTHFIRE,2, "sprites/mothfire2.png");
|
||||||
loadspriteimage(P_MOTHFIRE,3, "sprites/mothfire3.png");
|
loadspriteimage(P_MOTHFIRE,3, "sprites/mothfire3.png");
|
||||||
loadspriteimage(P_MOTHFIRE,4, "sprites/mothfire2.png");
|
loadspriteimage(P_MOTHFIRE,4, "sprites/mothfire4.png");
|
||||||
loadspriteimage(P_MOTHFIRE,5, "sprites/mothfire1.png");
|
loadspriteimage(P_MOTHFIRE,5, "sprites/mothfire5.png");
|
||||||
imageset[P_MOTHFIRE].numimages = 6;
|
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
|
// manual angry image for black cloud
|
||||||
|
@ -2118,11 +2122,15 @@ void drawsprite(sprite_t *s) {
|
||||||
if (isfruit(s->id)) {
|
if (isfruit(s->id)) {
|
||||||
frame = F_WALK1;
|
frame = F_WALK1;
|
||||||
} else if (isbullet(s->id)) {
|
} else if (isbullet(s->id)) {
|
||||||
|
if (s->id == P_MOTHFIRE) {
|
||||||
|
frame = s->timer1;
|
||||||
|
} else {
|
||||||
if ((timer/6) % 2 == 0) {
|
if ((timer/6) % 2 == 0) {
|
||||||
frame = F_WALK1;
|
frame = F_WALK1;
|
||||||
} else {
|
} else {
|
||||||
frame = F_JUMP;
|
frame = F_JUMP;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} else if (iseffect(s->id)) {
|
} else if (iseffect(s->id)) {
|
||||||
if ((s->id == P_PUFF) || (s->id == P_SMASH) || (s->id == P_SPARKLE) || (s->id == P_FLAME) ) {
|
if ((s->id == P_PUFF) || (s->id == P_SMASH) || (s->id == P_SPARKLE) || (s->id == P_FLAME) ) {
|
||||||
if (s->timer1 >= imageset[s->id].numimages) {
|
if (s->timer1 >= imageset[s->id].numimages) {
|
||||||
|
|