Added new monster - white spider

This commit is contained in:
Rob Pearce 2009-03-10 23:16:08 +00:00
parent dcc7d426e3
commit b51a69ca10
12 changed files with 202 additions and 63 deletions

View File

@ -1,31 +1,12 @@
bgfile kitchen2.png
bg 0
hurryup 30
hurryup 10
help
endhelp
monsters
0 29 13
134 33 13
23 36 13
6 20 10
158 2 27
16 15 27
16 19 24
16 22 21
16 5 21
158 3 18
16 5 18
16 6 18
16 7 18
16 9 18
16 11 18
15 15 18
17 2 18
17 1 18
17 17 18
17 19 18
17 21 18
17 23 18
134 18 15
171 3 25
0 38 28
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,
@ -33,40 +14,35 @@ 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,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,1,1,1,1,1,1,1,1,1,1,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,1,0,0,0,0,0,0,0,0,1,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0,0,0,0,0,0,7,0,0,0,0,1,0,0,0,0,7,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,7,0,0,0,0,1,0,0,0,0,7,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,7,0,0,0,0,1,0,0,0,0,7,0,0,4,
4,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,0,0,0,0,7,0,0,4,
4,0,0,0,0,0,7,0,0,0,0,0,0,0,0,0,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7,0,0,4,
4,0,0,0,0,0,7,0,0,0,0,0,0,0,0,0,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7,0,0,4,
4,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,4,
layer2
28,13,94,layer3
29,13,94,layer3
30,13,94,layer3
31,13,94,layer3
32,13,94,layer3
33,13,94,layer3
34,13,94,layer3
35,13,94,layer3
36,13,94,layer3
37,13,94,layer3
38,13,94,layer3
8,8,8
36,13,8
20,16,8
26,21,8
6,26,8
16,26,8

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

3
defs.h
View File

@ -444,7 +444,7 @@
#define S_SLOPE 2
// Sprite types
#define MAXPTYPES 171
#define MAXPTYPES 172
#define P_PLAYER 0
#define P_RAT 1
#define P_CHEESE 2
@ -621,6 +621,7 @@
#define P_GOLDCOIN 168
#define P_LAMP 169
#define P_GOLDBAR 170
#define P_WSPIDER 171
#define FLY_FLYTIME 150

148
rc.c
View File

@ -1349,6 +1349,9 @@ void nextlevel(void) {
player2->oncloud = B_FALSE;
}
// clear regrowth
numregrow = 0;
// load next level data
if (haspowerupany(PW_PHONE) && !isbosslevel(curlevelnum)) {
// don't add monsters
@ -2322,12 +2325,14 @@ void checkcollide(sprite_t *s) {
die(s);
}
} else {
printf("DB: player killed by %s\n",s2->name); fflush(stdout);
die(s);
}
} else {
// initial flashing black cloud doesn't kill player;
if ((s2->id == P_BLACKCLOUD) && (!s2->invuln)) {
die(s);
printf("DB: player killed by blackclodu\n"); fflush(stdout);
// play sound
playfx(FX_EVILLAUGH);
}
@ -4793,6 +4798,143 @@ printf("setting target to y = %d\n",ss->timer2);
/* moves like an angry rat all the time */
if (globpowerup != PW_CAMERA) {
if ((playersalive()) && (!s->jumping) && (!s->jumptimer)) {
sprite_t *abovep;
/* if player is above us...*/
abovep = isplayerabove(s);
if (abovep) {
if ((xdiff >= (TILEW*2)) && (xdiff <= (TILEW*3))) { // if 2-3 tiles right
/* jump right */
jump(s, D_RIGHT);
} else if ((xdiff <= -(TILEW*2)) && (xdiff >= -(TILEW*3))) { // if 2-3 tiles left
/* jump left */
jump(s, D_LEFT);
} else if (s->y - abovep->y <= (TILEH*6)) { // player less than 6 tiles above
if ((xdiff >= 0) && (xdiff < (TILEW*4))) { // ... and within 4 tiles
/* jump up */
jump(s, 0);
} else if ((xdiff <= 0) && (xdiff > -(TILEW*4))) { // ... and within 4 tiles
/* jump up */
jump(s, 0);
}
}
}
}
}
} else { // falling
movex(s, s->jumpdir*getspeed(s), B_TRUE);
}
} else if (s->id == P_WSPIDER) { // white spider - very intelligent!
// timer3 is climb direction
if (!s->falling) {
int move = B_FALSE;
int xdiff, absxdiff;
int ladderx = isladderabove(s);
/* distance to closest player */
xdiff = getxdisttoplayer(s, NULL);
absxdiff = abs(xdiff);
/* already climbing */
if (s->climbing) {
// TODO: replace with just climbing the current dir
if (s->timer3 == D_UP) {
// climb up
int ladderx = isladderabove(s);
// if tile above is non-solid, or a ladder
if (ladderx || !isroofabove(s)) {
/*
// lock to ladder
if (ladderx) {
s->x = ladderx; // lock to ladder
}
*/
// continue climbing
s->y -= getspeed(s);
s->jumping = 0;
s->falling = 0;
s->climbing = B_TRUE;
s->moved = MV_WALK;
}
} else { // down
if (isonladder(s)) {
// climb down
s->y += getspeed(s);
s->jumping = 0;
s->falling = 0;
s->climbing = B_TRUE;
s->moved = MV_WALK;
}
}
} else if (ladderx && isplayerabove(s)) { // if we are at the bottom of a ladder
// start climbing
s->x = ladderx; // lock to ladder
s->y -= getspeed(s);
s->jumping = 0;
s->falling = 0;
s->climbing = B_TRUE;
s->moved = MV_WALK;
s->timer3 = D_UP;
} else if (isonladder(s) && isplayerbelow(s)) { // is we are at top of ladder
int ladderx = isonladder(s);
s->y += getspeed(s);
s->jumping = 0;
s->falling = 0;
s->climbing = B_TRUE;
s->moved = MV_WALK;
// lock to centre of ladder
s->x = ladderx;
s->timer3 = D_DOWN;
} else {
// walk
tt = gettileat(s->x + s->dir+getspeed(s),s->y,NULL,NULL);
/* if there's a hole in front of us */
if (tt->solid == S_NOTSOLID) {
double ycutoff = s->y + (TILEH/2);
if ((player && (player->y >= ycutoff)) || (player2 && (player2->y >= ycutoff ))) {
/* if player is below and nearby, fall off */
if (xdiff <= (TILEW*16)) {
move = B_TRUE;
}
} else if ((player && (player->y == s->y)) || (player2 && (player2->y == s->y ))) {
if (globpowerup != PW_CAMERA) {
/* if player is at same level and close, jump */
if ((s->dir == D_RIGHT) && (xdiff > 0) && (xdiff <= (TILEW*7))) {
jump(s,D_RIGHT);
} else if ((s->dir == D_LEFT) && (xdiff < 0) && (xdiff >= -(TILEW*7))) {
jump(s,D_LEFT);
}
}
} else if (level->bottomopen && (s->y >= (480 - 100)) && isplayerabove(s)) {
// if near bottom of the screen and can fall through...
move = B_TRUE;
}
} else {
move = B_TRUE;
}
if (globpowerup == PW_CAMERA) {
move = B_TRUE;
}
/* either move or turn around */
if (move) {
rv = movex(s, s->dir*getspeed(s), B_TRUE);
if (rv) {
/* if we couldn't move (hit a wall), turn */
s->dir = -s->dir;
}
} else {
s->dir = -s->dir;
}
}
/* moves like an angry rat all the time */
if (globpowerup != PW_CAMERA) {
if ((playersalive()) && (!s->jumping) && (!s->jumptimer)) {
@ -5855,6 +5997,7 @@ void dotileeffects(sprite_t *s) {
if (!s->invuln) {
if ((s->id != P_BLACKCLOUD) && (s->id != P_KINGSNAIL)) {
die(s);
printf("DB: killed by spikes\n"); fflush(stdout);
}
}
}
@ -6525,6 +6668,9 @@ double getspeed(sprite_t *s ) {
} else if (id == P_RAT) {
if (s->angry) speed = 1.5;
else speed = 1;
} else if (id == P_WSPIDER) {
if (s->angry) speed = 1.5;
else speed = 1;
} else if (id == P_ANT1) {
if (s->angry) speed = 1.5;
else speed = 1;
@ -12075,6 +12221,8 @@ void startgame(void) {
fpsticks = 0;
fpsstart = 0;
numregrow = 0;
// init player variables - if player
// hasn't been allocated yet then this will
// be done so in loadlevel(), and the below

View File

@ -1404,6 +1404,18 @@ int loadimagesets(void) {
/* next 3 are auto generated */
imageset[P_ANT3].numimages = 8;
loadspriteimage(P_WSPIDER,F_WALK1, "sprites/whitespider.png");
loadspriteimage(P_WSPIDER,F_JUMP, "sprites/whitespider1.png");
loadspriteimage(P_WSPIDER,F_FALL, "sprites/whitespider1.png");
loadspriteimage(P_WSPIDER,F_CAUGHT, "sprites/whitespidercaught.png");
loadspriteimage(P_WSPIDER,F_DEAD, "sprites/whitespiderdead.png");
/* next 3 are auto generated */
loadspriteimage(P_WSPIDER,F_CLIMB1, "sprites/whitespiderclimb.png");
loadspriteimage(P_WSPIDER,F_CLIMB2, "sprites/whitespiderclimb1.png");
loadspriteimage(P_WSPIDER,F_SHOOT, "sprites/whitespiderclimb1.png"); // TO WORK AROUND A BUG!!
imageset[P_WSPIDER].numimages = 11;
loadspriteimage(P_SPIDER,F_WALK1, "sprites/newspider.png");
loadspriteimage(P_SPIDER,F_JUMP, "sprites/newspiderjump.png");
loadspriteimage(P_SPIDER,F_FALL, "sprites/newspiderfall.png");
@ -2009,10 +2021,8 @@ int loadimagesets(void) {
// free red image surface
SDL_FreeSurface(reds);
/* flipped angry image */
imageset[p].img[MAXFRAMES*3+i] = rotozoomSurfaceXY(imageset[p].img[MAXFRAMES*2+i], 0, -1,1,0);
SDL_SetColorKey(imageset[p].img[MAXFRAMES*3+i],SDL_RLEACCEL, 0);
}
}
@ -2172,7 +2182,7 @@ void drawsprite(sprite_t *s) {
} else {
frame = F_SWIM2;
}
} else if (s->netting) {
} else if (s->netting && isplayer(s)) {
frame = F_SHOOT;
} else if (s->iced) {
frame = F_WALK1;
@ -3222,6 +3232,7 @@ int ismonster(int id) {
case P_BEE:
case P_FLY:
case P_SPIDER:
case P_WSPIDER:
case P_SNAKE:
case P_TICK:
case P_PLANT:
@ -3746,6 +3757,7 @@ void setfruitinfo(void) {
setinfo(P_FISH, "Pirahna", "These fish at at home in the water and unhampered by slowness while swimming.", "fish.png");
setinfo(P_SPIDER, "Spider", "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, "White Spider", "White 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_FROG, "Frog", "Green frogs will continually bounce around, making them more difficult to catch. They are also excellent swimmers.", "frog.png");

BIN
website/img/whitespider.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

@ -32,7 +32,9 @@
<br>Soldier Ant</td><td>Soldiers move faster and are more intelligent than their worker siblings. In addition, with just a little food they will become queens.</td>
<td width=10% align=center><img src="img/ant3.png">
<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><tr bgcolor="#ffff00"><th colspan=4>Bosses</th></tr>
</tr><tr><td width=10% align=center><img src="img/whitespider.png">
<br>White Spider</td><td>White Spiders are more intelligent than other monsters - they are aware of nearby players and will use the landscape to track them down!</td>
<td colspan=2>&nbsp;</td></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>
</tr><tr><td align=center><img src="img/kingsnail.png"><br>King Snail</td><td>The absolute ruler of the snail kingdom is far too large and heavy to catch in a net. In addition, its shell provides protection against all attacks, leaving only its head vulnerable. While King Snail is too proud to chase down enemies itself, it can use its snail army to destroy its foes.</td>