- added hiss sound when snake shoots

- pill now makes you constantly animate
This commit is contained in:
Rob Pearce 2008-12-21 01:04:54 +00:00
parent 6a51fe8b34
commit 8d6a075fd4
5 changed files with 46 additions and 10 deletions

View File

@ -6,8 +6,9 @@ endhelp
monsters
0 5 23
134 35 22
23 12 19
6 20 10
23 12 23
12 24 19
endmonsters
exitdir 1
4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,
@ -30,7 +31,7 @@ exitdir 1
4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,
4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,
4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,
4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,
4,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,4,
4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,
4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,
4,0,0,0,0,0,0,0,17,0,0,0,0,0,17,0,0,0,0,0,17,0,0,0,0,0,17,0,0,0,0,17,0,0,0,0,0,0,0,4,

BIN
data/sounds/hiss.wav Normal file

Binary file not shown.

3
defs.h
View File

@ -321,7 +321,7 @@
/* enums */
/* sounds */
#define MAXFX 60
#define MAXFX 61
#define FX_SHOOT 0
#define FX_SLAM 1
#define FX_KILL 2
@ -382,6 +382,7 @@
#define FX_JETPACK 57
#define FX_CAMERA 58
#define FX_LASER 59
#define FX_HISS 60
// card suits
#define CS_HEART 1

2
rc.c
View File

@ -4087,6 +4087,7 @@ printf("setting target to y = %d\n",ss->timer2);
if (shoot) {
// if our shooting timer is okay
if (s->timer1 == 0) {
playfx(FX_HISS);
ss = addsprite(P_SPIT,s->x,s->y - s->img->h/2,"spit" );
ss->ys = 0;
ss->xs = s->dir * (getspeed(s)*2);
@ -8305,6 +8306,7 @@ int initsound(void) {
loadfx(FX_JETPACK, "jetpack.wav");
loadfx(FX_CAMERA, "camera.wav");
loadfx(FX_LASER, "laser.wav");
loadfx(FX_HISS, "hiss.wav");
// load sound effects
for (i = 0; i < MAXFX; i++) {

View File

@ -2064,6 +2064,13 @@ void drawsprite(sprite_t *s) {
frame = F_DEAD;
} else if (s->id == P_SLUG) {
frame = F_FALL;
} else if (s->powerup == PW_PILL) {
// toggle between walking frames FAST
if ((timer/3) % 2 == 0) {
frame = F_WALK1;
} else {
frame = F_JUMP;
}
} else {
frame = F_JUMP;
}
@ -2079,6 +2086,13 @@ void drawsprite(sprite_t *s) {
} else {
frame = F_FALL;
}
} else if (s->powerup == PW_PILL) {
// toggle between walking frames FAST
if ((timer/3) % 2 == 0) {
frame = F_WALK1;
} else {
frame = F_JUMP;
}
} else {
frame = F_FALL;
}
@ -2102,12 +2116,21 @@ void drawsprite(sprite_t *s) {
// DEFAULT FOR EVERYTHING
// walking / sliding
if (s->moved == MV_WALK) {
if (s->powerup == PW_PILL) {
// toggle between walking frames FAST
if ((timer/3) % 2 == 0) {
frame = F_WALK1;
} else {
frame = F_JUMP;
}
} else {
// toggle between walking frames
if ((timer/12) % 2 == 0) {
frame = F_WALK1;
} else {
frame = F_JUMP;
}
}
} else if (s->moved == MV_FLY) {
int animspeed;
// fly animates faster
@ -2127,12 +2150,21 @@ void drawsprite(sprite_t *s) {
frame = F_FALL;
}
} else if (s->moved == MV_ICE) {
} else if (s->moved == MV_ICE) { // sliding
frame = F_FALL;
} else { // standing still
if (s->powerup == PW_PILL) {
// toggle between walking frames FAST
if ((timer/3) % 2 == 0) {
frame = F_WALK1;
} else {
frame = F_JUMP;
}
} else {
frame = F_WALK1;
}
}
}
}
}