Replaced moth with bat

This commit is contained in:
Rob Pearce 2009-03-21 21:42:38 +00:00
parent f96f3305dc
commit 783fc7799c
22 changed files with 60 additions and 59 deletions

View File

@ -11,6 +11,7 @@ monsters
1 29 6
7 34 14
171 12 15
172 3 10
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,

BIN
data/sprites/bat.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1006 B

BIN
data/sprites/bat1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

BIN
data/sprites/batcaught.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 979 B

BIN
data/sprites/batdead.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 972 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

View File

Before

Width:  |  Height:  |  Size: 631 B

After

Width:  |  Height:  |  Size: 631 B

View File

Before

Width:  |  Height:  |  Size: 645 B

After

Width:  |  Height:  |  Size: 645 B

View File

Before

Width:  |  Height:  |  Size: 674 B

After

Width:  |  Height:  |  Size: 674 B

View File

Before

Width:  |  Height:  |  Size: 686 B

After

Width:  |  Height:  |  Size: 686 B

View File

Before

Width:  |  Height:  |  Size: 687 B

After

Width:  |  Height:  |  Size: 687 B

View File

Before

Width:  |  Height:  |  Size: 694 B

After

Width:  |  Height:  |  Size: 694 B

16
defs.h
View File

@ -289,12 +289,12 @@
#define KAS_JUMP2 7
// moth
#define MOTH_PAUSE 20
#define MOTH_FIRESPACE 3 // space between shots
#define BAT_PAUSE 20
#define BAT_FIRESPACE 3 // space between shots
// moth states
#define MS_FLY 0
#define MS_PAUSE1 1
#define MS_PAUSE2 2
#define BS_FLY 0
#define BS_PAUSE1 1
#define BS_PAUSE2 2
// bell states
@ -427,7 +427,7 @@
#define FX_CHOMP 61
#define FX_GROWL 62
#define FX_LAMP 63
#define FX_MOTHFIRE 64
#define FX_SONAR 64
// card suits
#define CS_HEART 1
@ -631,8 +631,8 @@
#define P_LAMP 169
#define P_GOLDBAR 170
#define P_WSPIDER 171
#define P_MOTH 172
#define P_MOTHFIRE 173
#define P_BAT 172
#define P_SONAR 173
#define FLY_FLYTIME 150

46
rc.c
View File

@ -5033,11 +5033,11 @@ int movesprite(sprite_t *s) {
movex(s, s->jumpdir*getspeed(s), B_TRUE);
faceplayer(s);
}
} else if (s->id == P_MOTH) {
} else if (s->id == P_BAT) {
/* timer1 tracks state, timer2 tracks previous direction
timer3 is current direction
*/
if (s->timer1 == MS_FLY) {
if (s->timer1 == BS_FLY) {
if (s->timer3 == D_NONE) {
int tx,ty;
int d;
@ -5098,9 +5098,9 @@ int movesprite(sprite_t *s) {
tt = gettileat(s->x, s->y - s->img->h - getspeed(s), NULL, NULL);
if (tt->solid) {
// hit a wall
s->timer1 = MS_PAUSE1;
s->timer1 = BS_PAUSE1;
s->timer2 = s->timer3; // old dir
s->timer3 = MOTH_PAUSE;
s->timer3 = BAT_PAUSE;
} else {
s->moved = MV_FLY;
s->y -= getspeed(s);
@ -5109,9 +5109,9 @@ int movesprite(sprite_t *s) {
tt = gettileat(s->x, s->y + getspeed(s), NULL, NULL);
if (tt->solid) {
// hit a wall
s->timer1 = MS_PAUSE1;
s->timer1 = BS_PAUSE1;
s->timer2 = s->timer3; // old dir
s->timer3 = MOTH_PAUSE;
s->timer3 = BAT_PAUSE;
} else {
s->moved = MV_FLY;
s->y += getspeed(s);
@ -5120,19 +5120,19 @@ int movesprite(sprite_t *s) {
s->dir = s->timer3;
if (movex(s, s->dir * getspeed(s), B_TRUE)) {
// hit a wall
s->timer1 = MS_PAUSE1;
s->timer1 = BS_PAUSE1;
s->timer2 = s->timer3; // old dir
s->timer3 = MOTH_PAUSE;
s->timer3 = BAT_PAUSE;
} else {
s->moved = MV_FLY;
}
}
}
} else if (s->timer1 == MS_PAUSE1) {
} else if (s->timer1 == BS_PAUSE1) {
s->moved = MV_FLY;
// wait for countdown...
s->timer3--;
if ((s->timer3 == MOTH_FIRESPACE*2) || (s->timer3 == MOTH_FIRESPACE) || (s->timer3 == 0)) {
if ((s->timer3 == BAT_FIRESPACE*2) || (s->timer3 == BAT_FIRESPACE) || (s->timer3 == 0)) {
sprite_t *ss,*target = NULL;
// closest player
target = getclosestplayer(s);
@ -5141,8 +5141,8 @@ int movesprite(sprite_t *s) {
// get angle towards target
ang = atan2(target->y - s->y, target->x - s->x);
// shoot
playfx(FX_MOTHFIRE);
ss = addsprite(P_MOTHFIRE,s->x,s->y - s->img->h/2,"mothfire" );
playfx(FX_SONAR);
ss = addsprite(P_SONAR,s->x,s->y - s->img->h/2,"bat_sonar" );
ss->xs = cos(ang) * getspeed(ss);
ss->ys = sin(ang) * getspeed(ss);
ss->timer1 = 0;
@ -5150,15 +5150,15 @@ int movesprite(sprite_t *s) {
}
if (s->timer3 == 0) {
// go to next state
s->timer1 = MS_PAUSE2;
s->timer3 = MOTH_PAUSE;
s->timer1 = BS_PAUSE2;
s->timer3 = BAT_PAUSE;
}
} else if (s->timer1 == MS_PAUSE2) {
} else if (s->timer1 == BS_PAUSE2) {
s->moved = MV_FLY;
s->timer3--;
if (s->timer3 == 0) {
// go to next state
s->timer1 = MS_FLY;
s->timer1 = BS_FLY;
s->timer3 = D_NONE;
}
}
@ -5761,12 +5761,12 @@ int movesprite(sprite_t *s) {
} else if (s->x <= TILEW) {
s->dead = D_FINAL;
}
} else if (s->id == P_MOTHFIRE) {
} else if (s->id == P_SONAR) {
// timer1 = frame
// update frame
if ((timer % 5) == 0) {
s->timer1++;
if (s->timer1 >= imageset[P_MOTHFIRE].numimages) {
if (s->timer1 >= imageset[P_SONAR].numimages) {
s->timer1 = 0;
}
}
@ -5776,11 +5776,11 @@ int movesprite(sprite_t *s) {
// die if it leaves screen
if (s->x >= (640-TILEW)) {
s->dead = D_FINAL;
} else if (s->x <= (-(s->img->w/2))) {
} else if (s->x <= TILEW) {
s->dead = D_FINAL;
} else if (s->y >= (480+(s->img->h))) {
s->dead = D_FINAL;
} else if (s->y <= 0) {
} else if (s->y <= TILEH) {
s->dead = D_FINAL;
}
} else if (s->id == P_RAYGUNBULLET) {
@ -6917,10 +6917,10 @@ double getspeed(sprite_t *s ) {
} else if (id == P_SPIDER) {
if (s->angry) speed = 2;
else speed = 1.5;
} else if (id == P_MOTH) {
} else if (id == P_BAT) {
if (s->angry) speed = 3;
else speed = 2.5;
} else if (id == P_MOTHFIRE) {
} else if (id == P_SONAR) {
speed = 2.5;
} else if (id == P_KINGRAT) {
speed = 1.5;
@ -9762,7 +9762,7 @@ int initsound(void) {
loadfx(FX_CHOMP, "chomp.wav");
loadfx(FX_GROWL, "growl.wav");
loadfx(FX_LAMP, "lamp.wav");
loadfx(FX_MOTHFIRE, "pea.wav");
loadfx(FX_SONAR, "pea.wav");
// load sound effects
for (i = 0; i < MAXFX; i++) {

View File

@ -862,8 +862,8 @@ void setdefaults(sprite_t *s) {
s->timer1 = KAS_WALK1;
s->timer2 = KA_WALKTIME;
s->timer3 = KA_SHOOTTIME;
} else if (s->id == P_MOTH) {
s->timer1 = MS_FLY;
} else if (s->id == P_BAT) {
s->timer1 = BS_FLY;
s->timer2 = D_NONE;
s->timer3 = D_NONE;
}
@ -879,7 +879,7 @@ void setdefaults(sprite_t *s) {
case P_BLACKCLOUD:
case P_SPIDER:
case P_KINGFLY:
case P_MOTH:
case P_BAT:
s->flies = B_TRUE;
break;
case P_FLY:
@ -1452,13 +1452,13 @@ int loadimagesets(void) {
loadspriteimage(P_WSPIDER,F_CLIMB2, "sprites/whitespiderclimb1.png");
imageset[P_WSPIDER].numimages = 10;
loadspriteimage(P_MOTH,F_WALK1, "sprites/moth.png");
loadspriteimage(P_MOTH,F_JUMP, "sprites/moth1.png");
loadspriteimage(P_MOTH,F_FALL, "sprites/moth1.png");
loadspriteimage(P_MOTH,F_CAUGHT, "sprites/mothcaught.png");
loadspriteimage(P_MOTH,F_DEAD, "sprites/mothdead.png");
loadspriteimage(P_BAT,F_WALK1, "sprites/bat.png");
loadspriteimage(P_BAT,F_JUMP, "sprites/bat1.png");
loadspriteimage(P_BAT,F_FALL, "sprites/bat1.png");
loadspriteimage(P_BAT,F_CAUGHT, "sprites/batcaught.png");
loadspriteimage(P_BAT,F_DEAD, "sprites/batdead.png");
/* next 3 are auto generated */
imageset[P_MOTH].numimages = 8;
imageset[P_BAT].numimages = 8;
loadspriteimage(P_SPIDER,F_WALK1, "sprites/newspider.png");
@ -1949,17 +1949,17 @@ int loadimagesets(void) {
loadspriteimage(P_BIGFIREBALL,1, "sprites/bigfire2.png");
imageset[P_BIGFIREBALL].numimages = 2;
loadspriteimage(P_MOTHFIRE,0, "sprites/mothfire0.png");
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/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;
loadspriteimage(P_SONAR,0, "sprites/sonar0.png");
loadspriteimage(P_SONAR,1, "sprites/sonar1.png");
loadspriteimage(P_SONAR,2, "sprites/sonar2.png");
loadspriteimage(P_SONAR,3, "sprites/sonar3.png");
loadspriteimage(P_SONAR,4, "sprites/sonar4.png");
loadspriteimage(P_SONAR,5, "sprites/sonar5.png");
loadspriteimage(P_SONAR,6, "sprites/sonar4.png");
loadspriteimage(P_SONAR,7, "sprites/sonar3.png");
loadspriteimage(P_SONAR,8, "sprites/sonar2.png");
loadspriteimage(P_SONAR,9, "sprites/sonar1.png");
imageset[P_SONAR].numimages = 10;
// manual angry image for black cloud
@ -2122,7 +2122,7 @@ void drawsprite(sprite_t *s) {
if (isfruit(s->id)) {
frame = F_WALK1;
} else if (isbullet(s->id)) {
if (s->id == P_MOTHFIRE) {
if (s->id == P_SONAR) {
frame = s->timer1;
} else {
if ((timer/6) % 2 == 0) {
@ -2846,7 +2846,7 @@ int isbullet(int id) {
if (id == P_SPIT) return B_TRUE;
if (id == P_FIREBALL) return B_TRUE;
if (id == P_BIGFIREBALL) return B_TRUE;
if (id == P_MOTHFIRE) return B_TRUE;
if (id == P_SONAR) return B_TRUE;
return B_FALSE;
}
@ -3306,7 +3306,7 @@ int ismonster(int id) {
case P_ANT1:
case P_ANT2:
case P_ANT3:
case P_MOTH:
case P_BAT:
return MT_MONSTER;
case P_BLACKCLOUD:
case P_KINGRAT:
@ -3822,7 +3822,7 @@ void setfruitinfo(void) {
setinfo(P_SPIDER, "Redback", "Redback spiders will lurk quietly on the ceiling, crawling back and forth. If they notice a player nearby however they will swiftly pounce down onto their prey!", "spider.png");
setinfo(P_WSPIDER, "Whitetail", "Whitetail spiders are more intelligent than other monsters - they are aware of nearby players and will use the landscape to track them down!", "whitespider.png");
setinfo(P_MOTH, "Moth", "The moth moves in straight lines until it hits a wall. Although simplistic in their movement, moths have the ability to fire a burst of hypno-rays to take out an unwary player!", "moth.png");
setinfo(P_BAT, "Bat", "The bat moves in a straight line until it hits a wall. Although simplistic in their movement, bats have the ability to fire a burst of sonar to take out an unwary player!", "bat.png");
setinfo(P_FROG, "Frog", "Green frogs will continually bounce around, making them more difficult to catch. They are also excellent swimmers.", "frog.png");
@ -3909,8 +3909,8 @@ void dumpinfo(void) {
printf("<img src=\"img/newspiderfall.png\">");
} else if (i == P_WSPIDER) {
printf("<img src=\"img/whitespiderclimb.png\">");
} else if (i == P_MOTH) {
printf("<img src=\"img/mothfire.png\">");
} else if (i == P_BAT) {
printf("<img src=\"img/sonar.png\">");
}
printf("<br>%s</td><td>%s</td>\n",

BIN
website/img/bat.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

View File

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -34,8 +34,8 @@
<img src="img/fire1.png"><br>Queen Ant</td><td>After an ant has eaten enough, they become a Queen. Queens are just as fast as soldiers and can also breath fire. Furthermore, they are only one meal away from spawning additional ants!</td>
</tr><tr><td width=10% align=center><img src="img/whitespider.png">
<img src="img/whitespiderclimb.png"><br>Whitetail</td><td>Whitetail spiders are more intelligent than other monsters - they are aware of nearby players and will use the landscape to track them down!</td>
<td width=10% align=center><img src="img/moth.png">
<img src="img/mothfire.png"><br>Moth</td><td>The moth moves in straight lines until it hits a wall. Although simplistic in their movement, moths have the ability to fire a burst of hypno-rays to take out an unwary player!</td>
<td width=10% align=center><img src="img/bat.png">
<img src="img/sonar.png"><br>Bat</td><td>The bat moves in a straight line until it hits a wall. Although simplistic in their movement, bats have the ability to fire a burst of sonar to take out an unwary player!</td>
</tr></tr><tr bgcolor="#ffff00"><th colspan=4>Bosses</th></tr>
<tr><td align=center><img src="img/cloud.png"><br>Cloud of Doom</td><td>This unkillable cloud will appear if you spend too much time on one level. Beware, as the only way to defeat the cloud of doom is to complete the level before it grows too large to handle!</td>
<td align=center><img src="img/kingrat.png"><br>King Rat</td><td>This mighty creature is the ruler of the rats, and impervious to the player's net. It can only be harmed by slamming another monster into it! King Rat will roam the level searching for a player, and upon spotting them will charge at high speed.</td>