diff --git a/blank.bmp b/blank.bmp index 4b7beea..25506ba 100644 Binary files a/blank.bmp and b/blank.bmp differ diff --git a/greentiles b/greentiles index e75bb15..f33a90f 100644 --- a/greentiles +++ b/greentiles @@ -63,5 +63,46 @@ end tile spikes id 10 solid 0 +spikes 1 file spikes.bmp end + +tile teleport +id 11 +solid 0 +file teleport.bmp +end + +tile teleport2 +id 12 +solid 0 +file teleport2.bmp +end + +tile teleportdest +id 13 +solid 0 +file teleexit.bmp +end + +tile water +id 14 +solid 0 +water 1 +file water.bmp +end + +tile watertop +id 15 +water 1 +solid 0 +file watertop.bmp +end + +tile waterspikes +id 16 +water 1 +solid 0 +spikes 1 +file waterspikes.bmp +end diff --git a/level8.dat b/level8.dat index c67a683..27a333c 100644 --- a/level8.dat +++ b/level8.dat @@ -2,33 +2,33 @@ tileset greentiles bg 0 hurryup 30 endmaps -**************************************** -*000000s00*0000000000000000000000000000* +*000000000*0000000000000000000000000000* +*000000000*0000000000000000000000000000* +*000000000*0000000000000000000000000000* +*000000000****************************** +*000000000000000000000000000000s0000000* *00000000000000000000000000000000000000* *00000000000000000000000000000000000000* *00000000000000000000000000000000000000* *00000000000000000000000000000000000000* -*00000000000000000000000000000000000000* -*00000000000000000000000000000000000a00* -*00000000000000000000000000000000000000* -*0a000000000000000000000000000000000000* -*00000000000000000000000000000000000000* -*00000000000000000000000000000000000000* -*00000000000000000000000000000000000000* -*00000000000000000000000000000000000000* -*00000000000000000000000000000000000000* -*00000000000000000000a00000000000000000* -*00000000000000000000000000000000000000* -*00000000000000000000000000000000000000* -*00000000000000000000000000000000000000* -*00000000000000000000000000000000000000* -*00000000000000000000000000000000000000* -*00000000000000000000000000000000000000* -*00000000000000000000000000000000000000* -*10000000000a0000000000000000a000000000* -***000>>>>>000>>>>>>>>>>>>>>000<<<<<<00* -*00000000000000000000000000000000000000* -*00000000000000000000000000000000000000* -*00000000000000000000000000000000000000* -*^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^* +*0.100000000000000000000000000000000r00* +****************000000000000000********* +*000000000000000000000000000000*0000000* +*000000000000000000000000000000*0r00000* +*000000000000000000000000000000*~~~~~~~* +*000000000000000000000000000000*0000000* +*000000000000000000000000000000*00000r0* +*0000000<<<<<<<<<<<<<<<<<<<<<<<*~~~~~~~* +*000000000000000000000000000000*0000000* +*000000000000000000000000000000*0000000* +*000000000000000000000000000000*00r0000* +*000000000000000000000000000000*~~~~~~~* +*000000000000000000000000000000*0000000* +*>>>>>>>>>>>>>>>>>>>>>>>>>00000*0000000* +*0000000000a0000000000000000000*000r000* +*000000000000000000000000000000*~~~~~~~* +*000000000000000000000000000000*0000000* +*0000a000000000000000000000^^^^*0000000* +*0;00000000000000000000000/*****0000000* +*0:0000000000000000000a00/******000r000* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/rc b/rc index f7da443..803ae04 100755 Binary files a/rc and b/rc differ diff --git a/rc.c b/rc.c index affc7cd..73d2c37 100644 --- a/rc.c +++ b/rc.c @@ -29,21 +29,23 @@ tiletype_t fakeblock; int fruittypes[] = { 2, - 2, + 9, + 10, + 11, + -1 +}; + + +int poweruptypes[] = { 3, - 2, - 2, 4, - 2, - 2, 5, - 2, - 2, 4, -1 }; int curfruittype = 0; +int curpoweruptype = 0; int gtime = 0; int fpsticks = 0; @@ -161,8 +163,24 @@ int main (int argc, char **argv) { if (levelcomplete == 1) { addtext(318,242,32,"Level Complete!",&black); addtext(320,240,32,"Level Complete!",&yellow); - levelcompletetime = gtime; levelcomplete = 2; + } else if (levelcomplete == 2) { + int mcount = 0; + sprite_t *s2; + + /* when all monsters have become fruits */ + for (s2 = sprite->next ; s2 ; s2 = s2->next) { + if (ismonster(s2->id)) { + if (s2->id != P_CLOUD) { + mcount++; + break; + } + } + } + if (mcount == 0) { + levelcompletetime = gtime; + levelcomplete = 3; + } } @@ -183,9 +201,9 @@ int main (int argc, char **argv) { return 1; } - if (!player->dead) { + if ((!player->dead) && (!player->teleporting)) { if (keys[SDLK_RIGHT]) { - if (!player->jumping) { + if ((!player->jumping) && (!player->slamming)) { if (!isonladder(player) || player->falling || isonground(player)) { movex(player, getspeed(player)); } @@ -193,7 +211,7 @@ int main (int argc, char **argv) { player->dir = 1; } if (keys[SDLK_LEFT]) { - if (!player->jumping) { + if ((!player->jumping) && (!player->slamming)) { if (!isonladder(player) || player->falling || isonground(player)) { movex(player, -getspeed(player)); } @@ -217,25 +235,33 @@ int main (int argc, char **argv) { } } if (keys[SDLK_x]) { - if (!player->jumping) { - if (!player->falling) { - if (isonground(player) || isonladder(player)) { - int whichway; - player->climbing = B_FALSE; - if (keys[SDLK_RIGHT]) { - whichway = 1; - } else if (keys[SDLK_LEFT]) { - whichway = -1; - } else { - whichway = 0; + if (isinwater(player)) { + player->jumping = B_FALSE; + player->falling = B_FALSE; + if (!isroofabove(player)) { + player->y -= (getspeed(player)*3); + } + } else { + if (!player->jumping) { + if (!player->falling) { + if (isonground(player) || isonladder(player)) { + int whichway; + player->climbing = B_FALSE; + if (keys[SDLK_RIGHT]) { + whichway = 1; + } else if (keys[SDLK_LEFT]) { + whichway = -1; + } else { + whichway = 0; + } + jump(player, whichway); } - jump(player, whichway); } } } } if (keys[SDLK_z]) { - if (!player->netting) { + if ((!player->netting) && (!player->slamming)) { if (keys[SDLK_DOWN]) { /* slam */ if ((!player->slamming) && (isonground(player))) { @@ -278,9 +304,10 @@ int main (int argc, char **argv) { } /* check collisions */ - for (s = sprite ; s ; s = s->next) { - checkcollide(s); - } + //for (s = sprite ; s ; s = s->next) { + // checkcollide(s); + //} + checkcollide(player); /* draw text */ drawtext(); @@ -329,13 +356,15 @@ void tick(void) { } } if (gtime == curlevel->hurryuptime + 10) { - addsprite(P_CLOUD, 320,240,"cloud"); - addtext(320,240,50, "Too slow!", &red); + if (!levelcomplete) { + addsprite(P_CLOUD, 320,240,"cloud"); + addtext(320,240,50, "Too slow!", &red); + } } /* 5 seconds after level completion */ - if (levelcomplete) { - if (gtime - levelcompletetime == 5) { + if (levelcomplete == 3) { + if (gtime - levelcompletetime >= 5) { if (!player->dead) { nextlevel(); } @@ -356,22 +385,36 @@ void nextlevel(void) { } void jump(sprite_t *s, int dir) { + if (s->jumping) return; + if (s->jumptimer) return; + if (isonground(s)) { - s->jumpdir = dir; - if (s->jumpdir != 0) { - s->dir = s->jumpdir; + if (ismonster(s->id)) { + s->jumpdir = dir; + if (s->jumpdir != 0) { + s->dir = s->jumpdir; + } + s->jumptimer = 60; + } else { + s->jumpdir = dir; + if (s->jumpdir != 0) { + s->dir = s->jumpdir; + } + s->jumping = 1; + s->jumpspeed = 5; } - s->jumping = 1; - s->jumpspeed = 5; } } void die(sprite_t *s) { int mcount = 0; sprite_t *s2; + /* clouds can't die like this */ + if (s->id == P_CLOUD) return; + /* release anything we've caught */ for (s2 = sprite->next ; s2 ; s2 = s2->next) { - if (s2->caughtby == player) { + if (s2->caughtby == s) { s2->caughtby = NULL; s2->angry = B_TRUE; } @@ -381,17 +424,21 @@ void die(sprite_t *s) { s->netting = 0; s->slamming = 0; - /* any mosnters left? */ - for (s2 = sprite->next ; s2 ; s2 = s2->next) { - if (ismonster(s2->id) && !s2->dead) { - mcount++; + /* any monsters left? */ + if (!levelcomplete) { + for (s2 = sprite->next ; s2 ; s2 = s2->next) { + if (ismonster(s2->id) && !s2->dead) { + if (s2->id != P_CLOUD) { + mcount++; + break; + } + } + } + + if (mcount == 0) { + levelcomplete = 1; } } - - if (mcount == 0) { - levelcomplete = 1; - } - } void cleanup(void) { @@ -423,10 +470,10 @@ void checkcollide(sprite_t *s) { if (ismonster(s2->id) && s2->id != P_CLOUD) { xdiff = (s->x + s->netlen*s->netdir) - s2->x; if (xdiff < 0) xdiff = -xdiff; - ydiff = s->netystart - s2->y; + ydiff = s->netystart - (s2->y - s2->img->h/2); if (ydiff < 0) ydiff = -ydiff; - if ((xdiff <= s2->img->w) && (ydiff <= s2->img->h)) { + if ((xdiff <= s2->img->w/2) && (ydiff <= s2->img->h)) { s2->caughtby = s; s2->jumping = 0; s2->falling = 0; @@ -439,7 +486,7 @@ void checkcollide(sprite_t *s) { /* check for collision with us */ xdiff = s->x - s2->x; if (xdiff < 0) xdiff = -xdiff; - ydiff = (s->y-s->img->h/2) - (s2->y-s2->img->h/2); + ydiff = (s->y-(s->img->h/2)) - (s2->y-(s2->img->h/2)); if (ydiff < 0) ydiff = -ydiff; if ((xdiff <= s->img->w/2 + s2->img->w/2) && @@ -447,7 +494,7 @@ void checkcollide(sprite_t *s) { /* COLLISION! */ if (isfruit(s2->id)) { if (s == player) { - int gotscore = 500; + int gotscore = s2->score; /* kill the fruit */ s2->dead = 4; /* handle fruit effects */ @@ -459,7 +506,7 @@ void checkcollide(sprite_t *s) { s->score += gotscore; } } - if (ismonster(s2->id)) { + if (ismonster(s2->id) || isbullet(s2->id)) { if ((s == player) && (!s->invuln)) { die(s); } @@ -528,8 +575,9 @@ void movesprite(sprite_t *s) { } return; } else if (s->dead == 1) { /* just set to dead */ - s->xs = ((rand() % 7)) - 3; - s->ys = ((rand() % 3) + 2) * -1; + //s->xs = ((rand() % 7)) - 3; + s->xs = ((rand() % 14) / 2) - 3; + s->ys = ((rand() % 3) + 3) * -1; s->dead = 2; s->bounces = 0; if (s == player) { @@ -634,15 +682,57 @@ void movesprite(sprite_t *s) { if (x > (640-TILEW)) x = 640-TILEW; if (x < (TILEW)) x = TILEW; - addsprite(fruittypes[curfruittype], x, y, "Fruit"); - if (fruittypes[++curfruittype] == -1) { - curfruittype = 0; - } + addsprite(s->willbecome, x, y, "Fruit"); } } } return; + } else if (s->teleporting > 0) { + SDL_Surface *ts; + if (timer % 2 == 0) { + /* shrink */ + if (s->teleporting == 1) { + ts = rotozoomSurfaceXY(s->img,0, 0.9 , 0.9 ,0); + s->img = ts; + } else { + ts = rotozoomSurfaceXY(s->img,0, 0.9 , 0.9 ,0); + SDL_FreeSurface(s->img); + s->img = ts; + } + + if ((s->img->w <= 2) || (s->img->h <= 2)) { + /* go to tele dest */ + int x,y; + /* find destination */ + for (y = 0; y < LEVELH; y++) { + for (x = 0; x < LEVELW; x++) { + tt = gettile(curlevel->map[y*LEVELW+x]); + if (tt->id == T_TELEPORTDEST) { + /* teleport there */ + s->x = (x * TILEW) + (TILEW/2); + s->y = (y * TILEH) + TILEH-2; + } + } + } + s->teleporting = -1; + } else s->teleporting++; + } + } else if (s->teleporting < 0) { + double size; + if (timer % 2 == 0) { + /* grow */ + size = (double)-s->teleporting / 10; + + SDL_FreeSurface(s->img); + if (size >= 1) { + s->teleporting = 0; + s->img = imageset[s->id].img[F_WALK1]; + } else { + s->img = rotozoomSurfaceXY(imageset[s->id].img[F_WALK1],0,size,size,0); + s->teleporting--; + } + } } else if (s->jumping) { movex(s, s->jumpdir*getspeed(s)); return; @@ -656,7 +746,17 @@ void movesprite(sprite_t *s) { } } - if (s->id == P_RAT) { + if (s->jumptimer) { + s->jumptimer--; + if (s->jumptimer == 0) { + s->jumping = 1; + s->jumpspeed = 5; + if (s->jumpdir != 0) s->dir = s->jumpdir; + return; + } else if (s->jumptimer % 20 == 0) { + s->dir = -s->dir; + } + } else if (s->id == P_RAT) { if (!s->falling) { int move = B_FALSE; int xdiff, absxdiff; @@ -701,7 +801,7 @@ void movesprite(sprite_t *s) { } if (s->angry) { - if ((player->dead == 0) && (!s->jumping)) { + if ((player->dead == 0) && (!s->jumping) && (!s->jumptimer)) { /* if player is above us, jump */ if (player->y < s->y) { if ((xdiff >= (TILEW*2)) && (xdiff <= (TILEW*3))) { @@ -730,6 +830,107 @@ void movesprite(sprite_t *s) { } } } + } else if (s->id == P_SNAKE) { + if (!s->falling) { + int move = B_FALSE; + int xdiff, absxdiff,ydiff; + + + /* distance to player */ + xdiff = player->x - s->x; + if (xdiff < 0) absxdiff = -xdiff; + else absxdiff = xdiff; + + 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) { + if ((player->y > s->y) && (s->angry)) { + /* if player is below, fall off */ + if (xdiff <= (TILEW*8)) { + move = B_TRUE; + } + } else if (player->y == s->y) { + if (s->angry) { + /* if player is at same level and close, jump */ + if ((s->dir == 1) && (xdiff > 0) && (xdiff <= (TILEW*7))) { + jump(s,1); + } else if ((s->dir == -1) && (xdiff < 0) && (xdiff >= -(TILEW*7))) { + jump(s,-1); + } + } + } + } else { + move = B_TRUE; + } + + /* shoot */ + ydiff = player->y - s->y; + if (ydiff < 0) ydiff =-ydiff; + + if (ydiff <= (TILEH*4)) { + sprite_t *ss; + int shoot = B_FALSE; + if (s->bullet == NULL) { + if ( (player->x < s->x) && (s->dir == -1) ) { + shoot = B_TRUE; + } else if ( (player->x < s->x) && (s->dir == -1) ) { + shoot = B_TRUE; + } + } + if (shoot) { + ss = addsprite(P_SPIT,s->x,s->y - s->img->h/2,"spit"); + ss->ys = 0; + ss->xs = s->dir * (getspeed(s)*2); + ss->dir = s->dir; + ss->owner = s; + + s->bullet = ss; + } + } + + /* either move or turn around */ + if (move) { + rv = movex(s, s->dir*getspeed(s)); + if (rv) { + /* if we couldn't move (hit a wall), turn */ + s->dir = -s->dir; + } + } else { + s->dir = -s->dir; + } + + + if (s->angry) { + if ((player->dead == 0) && (!s->jumping) && (!s->jumptimer)) { + /* if player is above us, jump */ + if (player->y < s->y) { + if ((xdiff >= (TILEW*2)) && (xdiff <= (TILEW*3))) { + /* jump right */ + jump(s, 1); + } else if ((xdiff <= -(TILEW*2)) && (xdiff >= -(TILEW*3))) { + /* jump left */ + jump(s, -1); + } else if (s->y - player->y <= (TILEH*6)) { + if ((xdiff >= 0) && (xdiff < (TILEW*2))) { + /* jump up */ + jump(s, 0); + } else if ((xdiff <= 0) && (xdiff > -(TILEW*2))) { + /* jump up */ + jump(s, 0); + } + } else { + /* jump whichever way we're facing */ + /* + s->jumpdir = s->dir; + s->jumping = 1; + s->jumpspeed = 5; + */ + } + } + } + } + } + } else if (s->id == P_BEE) { double absxs,absys; if ((s->xs == -99) || (s->ys == -99)) { @@ -749,13 +950,13 @@ void movesprite(sprite_t *s) { /* can we move? */ - tt = gettileat(s->x + absxs*((s->img->w/2)+2), s->y-(s->img->h/2),NULL,NULL); - if (tt->solid) { + tt = gettileat(s->x + absxs*((s->img->w/2)+8), s->y-(s->img->h/2),NULL,NULL); + if ((tt->solid) || (tt->spikes )) { /* turn */ s->xs = -s->xs; } tt = gettileat(s->x, s->y-(s->img->h/2) + absys*((s->img->h/2)+8),NULL,NULL); - if ((tt->solid) || (tt->id == T_SPIKES)) { + if ((tt->solid) || (tt->spikes)) { /* turn */ s->ys = -s->ys; } @@ -774,7 +975,7 @@ void movesprite(sprite_t *s) { } else if (s->falling) { /* if we are about to hit spikes, go back up */ tt = gettileat(s->x,s->y + 8,NULL,NULL); - if (tt->id == T_SPIKES) { + if (tt->spikes) { /* go back up */ s->flies = B_TRUE; s->falling = B_FALSE; @@ -803,7 +1004,7 @@ void movesprite(sprite_t *s) { /* drop if player is close */ xdiff = player->x - s->x; if (xdiff < 0) xdiff =-xdiff; - if ((player->y > s->y) && (xdiff <= (TILEW))) { + if ((player->y > s->y) && (xdiff <= (TILEW*2))) { s->flies = B_FALSE; s->falling = B_TRUE; s->fallspeed = 8; @@ -832,6 +1033,10 @@ void movesprite(sprite_t *s) { } } } + } else if (s->id == P_SPIT) { + if (movex(s, s->xs)) { + s->dead = 4; + } } else if (s->id == P_CLOUD) { if ((player->dead) || (levelcomplete)) { if ((s->img->h <= 3) || (s->img->w <= 3)) { @@ -848,17 +1053,28 @@ void movesprite(sprite_t *s) { } } else { if ((s->xs == -99) || (s->ys == -99)) { - s->ys = 0; + s->ys = 0.5; s->xs = 1; } s->x += s->xs; + s->y += s->ys; if (s->x >= (640 - s->img->w/2 - 5)) { s->xs = -s->xs; + s->x = 640 - s->img->w/2 - 6; } if (s->x <= (s->img->w/2 + 5)) { s->xs = -s->xs; + s->x = s->img->w/2 + 6; + } + if (s->y >= (480 - s->img->h/2 - 5)) { + s->ys = -s->ys; + s->y = 480 - s->img->h/2 - 6; + } + if (s->y <= (s->img->h/2 + 5)) { + s->ys = -s->ys; + s->y = s->img->h/2 + 6; } @@ -887,7 +1103,14 @@ void dotileeffects(sprite_t *s) { if (s->jumping || s->dead || s->caughtby) { return; } - + + /* check where we are */ + tt = gettileat(s->x,s->y-2,NULL,NULL); + if ((tt->id == T_TELEPORT) || (tt->id == T_TELEPORT2)) { + s->teleporting = 1; + } + + /* check under us */ tt = gettileat(s->x,s->y+3,NULL,NULL); while (!finished) { if (tt->id == T_RIGHT) { @@ -900,10 +1123,12 @@ void dotileeffects(sprite_t *s) { movex(s, -1.5); } finished = B_TRUE; - } else if (tt->id == T_SPIKES) { + } else if (tt->spikes) { if (!isfruit(s->id)) { if (!s->invuln) { - die(s); + if (s->id != P_CLOUD) { + die(s); + } } } finished = B_TRUE; @@ -991,6 +1216,7 @@ int loadlevel(int lnum) { int i; mapping_t mapping[MAXMAPPINGS]; int nmappings = 0; + tiletype_t *lasttile; level = malloc(sizeof(level_t)); @@ -1070,7 +1296,7 @@ int loadlevel(int lnum) { printf("invalid background tile id: %d\n",level->bgtileid); return B_TRUE; } - printf("Background tile id is %d (%s)\n",level->bgtileid,(gettile(level->bgtileid)->name)); + //printf("Background tile id is %d (%s)\n",level->bgtileid,(gettile(level->bgtileid)->name)); } else { printf("invalid background tile id line: '%s'\n",buf); return B_TRUE; @@ -1082,7 +1308,7 @@ int loadlevel(int lnum) { p = strtok(buf, " "); p = strtok(NULL, " "); level->hurryuptime = atoi(p); - printf("Hurryup time is %d\n",level->hurryuptime); + //printf("Hurryup time is %d\n",level->hurryuptime); } else { printf("invalid hurryup time line: '%s'\n",buf); return B_TRUE; @@ -1116,63 +1342,111 @@ int loadlevel(int lnum) { fgets(buf, BUFLEN, f); while (!feof(f)) { for (p = buf; *p; p++) { - if (*p == '~') { - tileid = T_LAND; - } else if (*p == '=') { - tileid = T_LADDER; - } else if (*p == '-') { - tileid = T_LADDERTOP; - } else if (*p == '>') { - tileid = T_RIGHT; - } else if (*p == '<') { - tileid = T_LEFT; - } else if (*p == '^') { - tileid = T_SPIKES; - } else if (*p == 'c') { - tileid = level->bgtileid; - level->initm[level->nummonsters].startx = x*TILEW+(TILEW/2); - level->initm[level->nummonsters].starty = y*TILEH+(TILEH-2); - level->initm[level->nummonsters].id = P_CLOUD; - level->nummonsters++; - } else if (*p == 'r') { - tileid = level->bgtileid; - level->initm[level->nummonsters].startx = x*TILEW+(TILEW/2); - level->initm[level->nummonsters].starty = y*TILEH+(TILEH-2); - level->initm[level->nummonsters].id = P_RAT; - level->nummonsters++; - } else if (*p == 'a') { - tileid = level->bgtileid; - level->initm[level->nummonsters].startx = x*TILEW+(TILEW/2); - level->initm[level->nummonsters].starty = y*TILEH+(TILEH-2); - level->initm[level->nummonsters].id = P_BEE; - level->nummonsters++; - } else if (*p == 's') { - tileid = level->bgtileid; - level->initm[level->nummonsters].startx = x*TILEW+(TILEW/2); - level->initm[level->nummonsters].starty = y*TILEH+TILEH; - level->initm[level->nummonsters].id = P_SPIDER; - level->nummonsters++; - } else if (*p == '*') { - tileid = T_FULL; - } else if (*p == '/') { - tileid = T_SLOPEUP; - } else if (*p == '\\') { - tileid = T_SLOPEDOWN; - } else if (*p == '1') { - tileid = level->bgtileid; - level->p1x = x; - level->p1y = y; - } else { - int n,found = 0; - /* search mappings */ - for (n = 0; n < nmappings; n++) { - if (mapping[n].ch == *p) { - tileid = mapping[n].tnum; - found = B_TRUE; - break; - } + int n,found = 0; + /* search mappings */ + for (n = 0; n < nmappings; n++) { + if (mapping[n].ch == *p) { + tileid = mapping[n].tnum; + found = B_TRUE; + break; } - if (!found) { + } + if (!found) { + + if (*p == '~') { + tileid = T_LAND; + } else if (*p == '=') { + tileid = T_LADDER; + } else if (*p == '-') { + tileid = T_LADDERTOP; + } else if (*p == '{') { + tileid = T_WATERTOP; + } else if (*p == '}') { + tileid = T_WATER; + } else if (*p == '>') { + tileid = T_RIGHT; + } else if (*p == '<') { + tileid = T_LEFT; + } else if (*p == '^') { + tileid = T_SPIKES; + } else if (*p == 'c') { + tileid = level->bgtileid; + level->initm[level->nummonsters].startx = x*TILEW+(TILEW/2); + level->initm[level->nummonsters].starty = y*TILEH+(TILEH-2); + level->initm[level->nummonsters].id = P_CLOUD; + level->nummonsters++; + } else if (*p == 'r') { + /* figure out background type */ + if (lasttile->solid) { + tileid = level->map[(y-1)*LEVELW+x]; + } else { + tileid = lasttile->id; + } + + // tileid = level->bgtileid; + level->initm[level->nummonsters].startx = x*TILEW+(TILEW/2); + level->initm[level->nummonsters].starty = y*TILEH+(TILEH-2); + level->initm[level->nummonsters].id = P_RAT; + level->nummonsters++; + } else if (*p == 'S') { + /* figure out background type */ + if (lasttile->solid) { + tileid = level->map[(y-1)*LEVELW+x]; + } else { + tileid = lasttile->id; + } + + // tileid = level->bgtileid; + level->initm[level->nummonsters].startx = x*TILEW+(TILEW/2); + level->initm[level->nummonsters].starty = y*TILEH+(TILEH-2); + level->initm[level->nummonsters].id = P_SNAKE; + level->nummonsters++; + } else if (*p == 'a') { + /* figure out background type */ + if (lasttile->solid) { + tileid = level->map[(y-1)*LEVELW+x]; + } else { + tileid = lasttile->id; + } + + level->initm[level->nummonsters].startx = x*TILEW+(TILEW/2); + level->initm[level->nummonsters].starty = y*TILEH+(TILEH-2); + level->initm[level->nummonsters].id = P_BEE; + level->nummonsters++; + } else if (*p == 's') { + /* figure out background type */ + if (lasttile->solid) { + tileid = level->map[(y-1)*LEVELW+x]; + } else { + tileid = lasttile->id; + } + + level->initm[level->nummonsters].startx = x*TILEW+(TILEW/2); + level->initm[level->nummonsters].starty = y*TILEH+TILEH; + level->initm[level->nummonsters].id = P_SPIDER; + level->nummonsters++; + } else if (*p == '*') { + tileid = T_FULL; + } else if (*p == ';') { + tileid = T_TELEPORT; + } else if (*p == ':') { + tileid = T_TELEPORT2; + } else if (*p == '.') { + tileid = T_TELEPORTDEST; + } else if (*p == '/') { + tileid = T_SLOPEUP; + } else if (*p == '\\') { + tileid = T_SLOPEDOWN; + } else if (*p == '1') { + /* figure out background type */ + if (lasttile->solid) { + tileid = level->map[(y-1)*LEVELW+x]; + } else { + tileid = lasttile->id; + } + level->p1x = x; + level->p1y = y; + } else { tileid = level->bgtileid; } } @@ -1187,6 +1461,8 @@ int loadlevel(int lnum) { return B_TRUE; } level->map[y*LEVELW+x] = tileid; + + lasttile = gettile(tileid); x++; } if (x < LEVELW+1) { @@ -1273,6 +1549,8 @@ int loadtiletypes(char *filename) { /* defaults */ t->id = 0; + t->water = B_FALSE; + t->spikes = B_FALSE; t->solid = B_TRUE; for (i = 0; i < TILEW; i++) { t->lowness[i] = 0; @@ -1283,7 +1561,7 @@ int loadtiletypes(char *filename) { } } else if (state == 1) { /* inside a definition */ if (strstr(buf, "end") == buf) { - printf("got tile %d: %s (solid=%d)\n",t->id,t->name,t->solid); + //printf("got tile %d: %s (solid=%d)\n",t->id,t->name,t->solid); state = 0; } else if (strstr(buf, "id") == buf) { p = strtok(buf, " "); @@ -1301,6 +1579,14 @@ int loadtiletypes(char *filename) { p = strtok(buf, " "); p = strtok(NULL, " "); t->solid = atoi(p); + } else if (strstr(buf, "spikes") == buf) { + p = strtok(buf, " "); + p = strtok(NULL, " "); + t->spikes = atoi(p); + } else if (strstr(buf, "water") == buf) { + p = strtok(buf, " "); + p = strtok(NULL, " "); + t->water = atoi(p); } else if (strstr(buf, "file") == buf) { p = strtok(buf, " "); p = strtok(NULL, " "); @@ -1332,6 +1618,8 @@ int loadimagesets(void) { int p,i; SDL_Surface *tempimg; + SDL_Surface *reds; + imageset[P_PLAYER].img[F_WALK1] = IMG_Load("pdwarf.png"); imageset[P_PLAYER].img[F_JUMP] = IMG_Load("pdwarfjump.png"); imageset[P_PLAYER].img[F_FALL] = IMG_Load("pdwarffall.png"); @@ -1342,6 +1630,15 @@ int loadimagesets(void) { imageset[P_PLAYER].img[F_CLIMB2] = IMG_Load("dclimb2.png"); imageset[P_PLAYER].numimages = 10; + imageset[P_SNAKE].img[F_WALK1] = IMG_Load("snake.bmp"); + imageset[P_SNAKE].img[F_JUMP] = IMG_Load("snakejump.bmp"); + imageset[P_SNAKE].img[F_FALL] = IMG_Load("snakejump.bmp"); + imageset[P_SNAKE].img[F_CAUGHT] = IMG_Load("snakecaught.bmp"); + imageset[P_SNAKE].img[F_DEAD] = IMG_Load("snakedead.bmp"); + /* next 3 are auto generated */ + imageset[P_SNAKE].numimages = 8; + + imageset[P_RAT].img[F_WALK1] = IMG_Load("rat.bmp"); imageset[P_RAT].img[F_JUMP] = IMG_Load("ratjump.bmp"); imageset[P_RAT].img[F_FALL] = IMG_Load("ratjump.bmp"); @@ -1376,6 +1673,15 @@ int loadimagesets(void) { imageset[P_CHEESE].img[F_WALK1] = IMG_Load("cheese.bmp"); imageset[P_CHEESE].numimages = 1; + imageset[P_ICECREAM].img[F_WALK1] = IMG_Load("icecream.bmp"); + imageset[P_ICECREAM].numimages = 1; + + imageset[P_CHIPS].img[F_WALK1] = IMG_Load("chips.bmp"); + imageset[P_CHIPS].numimages = 1; + + imageset[P_BURGER].img[F_WALK1] = IMG_Load("burger.bmp"); + imageset[P_BURGER].numimages = 1; + imageset[P_SPEED].img[F_WALK1] = IMG_Load("speed.bmp"); imageset[P_SPEED].numimages = 1; @@ -1385,9 +1691,16 @@ int loadimagesets(void) { imageset[P_BIGNET].img[F_WALK1] = IMG_Load("bignet.bmp"); imageset[P_BIGNET].numimages = 1; + /* bullets */ + imageset[P_SPIT].img[F_WALK1] = IMG_Load("spit.bmp"); + imageset[P_SPIT].numimages = 1; + + + + /* generate rotated/flipped images */ for (p = 0; p < MAXPTYPES; p++) { - if (!isfruit(p)) { + if (!isfruit(p) && !isbullet(p)) { tempimg = rotozoomSurface(imageset[p].img[F_DEAD],90,1,0); imageset[p].img[F_DEAD2] = SDL_DisplayFormat(tempimg); @@ -1399,12 +1712,67 @@ int loadimagesets(void) { } for (i = 0; i < imageset[p].numimages; i++) { + SDL_Surface *origi; + SDL_SetColorKey(imageset[p].img[i], SDL_SRCCOLORKEY, SDL_MapRGB(screen->format, 0, 0, 0)); + origi = imageset[p].img[i]; + + /* flipped image */ imageset[p].img[MAXFRAMES+i] = rotozoomSurfaceXY(imageset[p].img[i], 0, -1,1,0); + SDL_SetColorKey(imageset[p].img[MAXFRAMES+i], + SDL_SRCCOLORKEY, SDL_MapRGB(screen->format, 0, 0, 0)); + + + + /* angry image */ + reds = SDL_CreateRGBSurface(SDL_SWSURFACE, + origi->w, + origi->h, + origi->format->BitsPerPixel, origi->format->Rmask, + origi->format->Gmask,origi->format->Bmask, 0); + SDL_FillRect(reds, NULL, SDL_MapRGB(reds->format, 255, 0, 0)); + SDL_SetAlpha(reds, SDL_SRCALPHA,100); + + imageset[p].img[MAXFRAMES*2+i] = rotozoomSurfaceXY(origi, 0, 1,1,0); + + + SDL_BlitSurface(reds, NULL, imageset[p].img[MAXFRAMES*2+i], NULL); + SDL_FreeSurface(reds); + + temps = SDL_DisplayFormat(imageset[p].img[MAXFRAMES*2+i]); + SDL_FreeSurface(imageset[p].img[MAXFRAMES*2+i]); + imageset[p].img[MAXFRAMES*2+i] = temps; + + SDL_SetColorKey(imageset[p].img[MAXFRAMES*2+i], + SDL_SRCCOLORKEY, SDL_MapRGB(imageset[p].img[MAXFRAMES*2+i]->format, 101, 0, 0)); + + + /* flipped angry image */ + reds = SDL_CreateRGBSurface(SDL_SWSURFACE, + origi->w, + origi->h, + origi->format->BitsPerPixel, origi->format->Rmask, + origi->format->Gmask,origi->format->Bmask, 0); + SDL_FillRect(reds, NULL, SDL_MapRGB(reds->format, 255, 0, 0)); + SDL_SetAlpha(reds, SDL_SRCALPHA,100); + + imageset[p].img[MAXFRAMES*3+i] = rotozoomSurfaceXY(origi, 0, -1,1,0); + + + SDL_BlitSurface(reds, NULL, imageset[p].img[MAXFRAMES*3+i], NULL); + SDL_FreeSurface(reds); + + temps = SDL_DisplayFormat(imageset[p].img[MAXFRAMES*3+i]); + SDL_FreeSurface(imageset[p].img[MAXFRAMES*3+i]); + imageset[p].img[MAXFRAMES*3+i] = temps; + + SDL_SetColorKey(imageset[p].img[MAXFRAMES*3+i], + SDL_SRCCOLORKEY, SDL_MapRGB(imageset[p].img[MAXFRAMES*3+i]->format, 101, 0, 0)); + } } @@ -1413,23 +1781,29 @@ int loadimagesets(void) { double getspeed(sprite_t *s ) { int id = s->id; + double speed = 1; if (id == P_PLAYER) { - return s->speed; + speed = s->speed; } else if (id == P_RAT) { - if (s->angry) return 1.5; - else return 1; + if (s->angry) speed = 1.5; + else speed = 1; + } else if (id == P_SNAKE) { + if (s->angry) speed = 1.5; + else speed = 1; } else if (id == P_BEE) { - if (s->angry) return 2; - else return 1; + if (s->angry) speed = 2; + else speed = 1; } else if (id == P_SPIDER) { - if (s->angry) return 1.5; - else return 2; + if (s->angry) speed = 1.5; + else speed = 2; } else if (id == P_CHEESE) { - return 0; + speed = 0; } - return 1; + if (isinwater(s)) speed /= 2; + + return speed; } @@ -1599,6 +1973,7 @@ void killtext(text_t *t) { void setdefaults(sprite_t *s) { s->speed = 1; + s->teleporting = 0; s->climbing = 0; s->jumping = 0; s->jumpspeed = 0; @@ -1614,6 +1989,12 @@ void setdefaults(sprite_t *s) { s->dead = 0; s->angry = 0; s->invuln = 0; + s->jumptimer = 0; + + s->bullet = NULL; + s->owner = NULL; + + s->willbecome = P_CHEESE; switch (s->id) { case P_BEE: @@ -1626,6 +2007,24 @@ void setdefaults(sprite_t *s) { } + switch (s->id) { + case P_CHEESE: + s->score = 500; + break; + case P_ICECREAM: + s->score = 1000; + break; + case P_CHIPS: + s->score = 2000; + break; + case P_BURGER: + s->score = 4000; + break; + default: + break; + + } + s->caughtby = NULL; s->caughtstate = 0; @@ -1635,7 +2034,7 @@ void setdefaults(sprite_t *s) { s->timer = 0; } -int addsprite(int id, int x, int y, char *name ) { +sprite_t *addsprite(int id, int x, int y, char *name ) { sprite_t *s; if (sprite == NULL) { @@ -1684,7 +2083,7 @@ int addsprite(int id, int x, int y, char *name ) { lastsprite = s; - return B_FALSE; + return s; } int loadsprites(void) { @@ -1780,6 +2179,8 @@ void drawsprite(sprite_t *s) { /* select frame */ if (isfruit(s->id)) { frame = F_WALK1; + } else if (isbullet(s->id)) { + frame = F_WALK1; } else if (s->dead) { if (s == player) { frame = F_DEAD; @@ -1794,7 +2195,7 @@ void drawsprite(sprite_t *s) { frame = F_JUMP; } else if (s->falling) { frame = F_FALL; - } else { + } else if (!s->teleporting) { if ((s->id == P_SPIDER) && (s->ys != -99)) { frame = F_FALL; } else { @@ -1810,12 +2211,17 @@ void drawsprite(sprite_t *s) { } } + /* x-flip if required */ if (s->dir == -1) { frame += MAXFRAMES; } + /* make red if required */ + if (s->angry) { + frame += (MAXFRAMES*2); + } - if (s->id != P_CLOUD) { + if ((s->id != P_CLOUD) && (!s->teleporting)) { s->img = imageset[s->id].img[frame]; } @@ -1895,6 +2301,17 @@ void removenetting(sprite_t *s) { void killsprite(sprite_t *s) { sprite_t *nextone, *lastone; + sprite_t *s2; + + /* remove references to this sprite before removing it */ + for (s2 = sprite ; s2 ; s2 = s2->next) { + if (s2->owner == s) { + s2->owner = NULL; + } + if (s2->bullet == s) { + s2->bullet = NULL; + } + } nextone = s->next; if (nextone != NULL) { @@ -1969,6 +2386,30 @@ int isladderabove(sprite_t *s) { return B_FALSE; } +int isinwater(sprite_t *s) { + tiletype_t *tt; + tt = gettileat(s->x, s->y - s->img->h/2, NULL, NULL); + if (tt->water) { + return B_TRUE; + } + + return B_FALSE; +} + +int isroofabove(sprite_t *s) { + tiletype_t *tt; + + /* get tile above sprite's head */ + tt = gettileat(s->x, s->y - s->img->h,NULL,NULL); + if (tt->solid) return B_TRUE; + tt = gettileat(s->x + s->img->w/2, s->y - s->img->h,NULL,NULL); + if (tt->solid) return B_TRUE; + tt = gettileat(s->x - s->img->w/2, s->y - s->img->h,NULL,NULL); + if (tt->solid) return B_TRUE; + + return B_FALSE; +} + int isonground(sprite_t *s) { /* get tile below sprite's feet */ if (isongroundpoint(s, s->x, s->y)) { @@ -2031,6 +2472,8 @@ void dogravity(sprite_t *s) { if (s->dead) return; if (s->flies) return; + if (isbullet(s->id)) return; + if (isonladder(s) && !s->falling && !s->jumping) { s->falling = B_FALSE; return; @@ -2057,7 +2500,11 @@ void dogravity(sprite_t *s) { s->fallspeed = 1; } s->falling = B_TRUE; - s->y += s->fallspeed; + if (isinwater(s)) { + s->y += (s->fallspeed/2); + } else { + s->y += s->fallspeed; + } if ((timer % 10 == 0) && (s->fallspeed < FALLSPEED)) { s->fallspeed++; } @@ -2089,6 +2536,9 @@ void dogravity(sprite_t *s) { s->slamming = 0; + /* reset fruit type counter */ + curfruittype = 0; + /* kill anything we've caught */ for (s2 = sprite; s2 ; s2 = s2->next) { /* kill anything we have caught */ @@ -2097,6 +2547,12 @@ void dogravity(sprite_t *s) { tt = gettileat(s2->x,s2->y+2,NULL,NULL); /* if on ground, monster dies */ if ((tt == NULL) || (tt->solid)) { + /* becomes a fruit */ + s2->willbecome = fruittypes[curfruittype]; + /* increment fruit type */ + if (fruittypes[++curfruittype] == -1) { + curfruittype = 0; + } die(s2); pointsinc *= 2; psize += 10; @@ -2119,6 +2575,11 @@ void dogravity(sprite_t *s) { if ((xdiff <= s2->img->w) && (ydiff <= s2->img->h)) { if (s2->id != P_CLOUD) { + /* becomes a powerup */ + s2->willbecome = poweruptypes[curpoweruptype]; + if (poweruptypes[++curpoweruptype] == -1) { + curpoweruptype = 0; + } die(s2); pointsinc *= 2; psize += 10; @@ -2166,9 +2627,11 @@ int movex(sprite_t *s,double amt) { tt = gettileat(s->x, s->y, &tilex,&tiley); + if (amt > 0) amtdir = 1; else (amtdir = -1); + curx = s->x; cury = s->y; @@ -2251,6 +2714,9 @@ int dofruiteffect(sprite_t *s) { int isfruit(int id) { switch (id) { case P_CHEESE: + case P_ICECREAM: + case P_CHIPS: + case P_BURGER: case P_SPEED: case P_NUMNETS: case P_BIGNET: @@ -2261,15 +2727,35 @@ int isfruit(int id) { return B_FALSE; } +int isbullet(int id) { + if (id == P_SPIT) return B_TRUE; + + return B_FALSE; +} + int ismonster(int id) { if (id == P_RAT) return B_TRUE; if (id == P_BEE) return B_TRUE; if (id == P_SPIDER) return B_TRUE; + if (id == P_SNAKE) return B_TRUE; if (id == P_CLOUD) return B_TRUE; return B_FALSE; } +inline void drawpixel32(SDL_Surface *screen, int x, int y, SDL_Color c) +{ + Uint32 *bufp; + + /* check x/y */ + if (x >= screen->w) return; + if (y >= screen->h) return; + if (x < 0) return; + if (y < 0) return; + + bufp = (Uint32 *)screen->pixels + (y*screen->pitch / 2) + x; + *bufp = SDL_MapRGB(screen->format, c.r, c.g, c.b); +} inline void drawpixel16(SDL_Surface *screen, int x, int y, SDL_Color c) { @@ -2372,3 +2858,64 @@ void drawbox16(SDL_Surface *screen, int x1, int y1, int x2, int y2, SDL_Color *c drawline16(screen,x2,y1,x2,y2,*c); } + + +int getcolor(SDL_Surface *dest, int x, int y, SDL_Color *col) { + Uint32 pixel; + int bpp = dest->format->BytesPerPixel; + char *ppos; + unsigned char r,g,b,a; + + + ppos = (char *) dest->pixels; + + /* offset y */ + ppos += (dest->pitch * y); + /* offset x */ + ppos += (bpp * x); + + memcpy(&pixel, ppos, bpp); + + + if (dest->format->BitsPerPixel == 32) { + SDL_GetRGBA(pixel, dest->format, &r,&g,&b, &a); + col->r = r; + col->g = g; + col->b = b; + col->unused = a; + } else if (dest->format->BitsPerPixel == 16) { + SDL_GetRGB(pixel, dest->format, &r,&g,&b); + col->r = r; + col->g = g; + col->b = b; + } else if (dest->format->BitsPerPixel == 8) { + *col = dest->format->palette->colors[(Uint8)pixel]; + } + + + return 0; + +/* + bpp = dest->format->BytesPerPixel; + + if (bpp != 2) { + printf("bpp isnt 2!!!\n"); + fflush(stdout); + } + + //pixel = (Uint32 *) (dest->pixels + (y * dest->w) + x) ; + pixel = (Uint32 *) (dest->pixels + y * dest->pitch + x * bpp); + + + + SDL_GetRGB(*pixel,dest->format, + &col->r, + &col->g, + &col->b ); + + return 0; +*/ + + + +} diff --git a/rc.h b/rc.h index 6a56727..22736e4 100644 --- a/rc.h +++ b/rc.h @@ -34,7 +34,7 @@ #define S_SOLID 1 #define S_SLOPE 2 -#define MAXPTYPES 9 +#define MAXPTYPES 14 #define P_PLAYER 0 #define P_RAT 1 #define P_CHEESE 2 @@ -44,6 +44,11 @@ #define P_BEE 6 #define P_SPIDER 7 #define P_CLOUD 8 +#define P_ICECREAM 9 +#define P_CHIPS 10 +#define P_BURGER 11 +#define P_SNAKE 12 +#define P_SPIT 13 #define F_WALK1 0 #define F_JUMP 1 @@ -67,6 +72,12 @@ #define T_RIGHT 8 #define T_LEFT 9 #define T_SPIKES 10 +#define T_TELEPORT 11 +#define T_TELEPORT2 12 +#define T_TELEPORTDEST 13 +#define T_WATER 14 +#define T_WATERTOP 15 +#define T_WATERSPIKES 16 @@ -80,6 +91,8 @@ typedef struct tiletype_s { char name[SMALLBUFLEN]; int lowness[TILEW]; int solid; + int water; + int spikes; SDL_Surface *img; struct tiletype_s *next; struct tiletype_s *prev; @@ -132,8 +145,12 @@ typedef struct sprite_s { int jumping; int jumpdir; + int willbecome; + int angry; + int teleporting; + int dead; int invuln; int bounces; @@ -157,6 +174,7 @@ typedef struct sprite_s { int netystart; int timer; + int jumptimer; int moved; @@ -164,6 +182,10 @@ typedef struct sprite_s { double xs,ys; + + struct sprite_s *bullet; + struct sprite_s *owner; + double x,y; int dir; SDL_Surface *img; @@ -174,7 +196,7 @@ typedef struct sprite_s { } sprite_t; typedef struct imageset_s { - SDL_Surface *img[MAXFRAMES*2]; + SDL_Surface *img[MAXFRAMES*4]; int numimages; } imageset_t; imageset_t imageset[MAXPTYPES]; @@ -188,7 +210,7 @@ void movetext(void); void killtext(text_t *t); void removeall(void); void removetext(void); -int addsprite(int id,int x, int y, char *name); +sprite_t *addsprite(int id,int x, int y, char *name); int loadtiletypes(char *filename); tiletype_t *gettileat(int pixx,int pixy, int *tilex, int *tiley); int loadlevel(int lnum); @@ -204,6 +226,8 @@ void dogravity(sprite_t *s); void dotileeffects(sprite_t *s); int movex(sprite_t *s,double amt); void movesprite(sprite_t *s); +int isinwater(sprite_t *s); +int isroofabove(sprite_t *s); int isonground(sprite_t *s); int isongroundpoint(sprite_t *s, int x, int y); int isonladder(sprite_t *s); @@ -211,6 +235,7 @@ int isladderabove(sprite_t *s); int isfruit(int id); int dofruiteffect(sprite_t *s); int ismonster(int id); +int isbullet(int id); void killsprite(sprite_t *s); void checkcollide(sprite_t *s); void die(sprite_t *s); @@ -223,5 +248,7 @@ void tick(void); inline void drawpixel16(SDL_Surface *screen, int x, int y, SDL_Color c); +inline void drawpixel32(SDL_Surface *screen, int x, int y, SDL_Color c); inline void drawbox16(SDL_Surface *screen, int x1,int y1,int x2,int y2,SDL_Color *c,SDL_Color *fc); void drawline16(SDL_Surface *screen, int x1, int y1, int x2, int y2, SDL_Color c); +int getcolor(SDL_Surface *dest, int x, int y, SDL_Color *col); diff --git a/spider.bmp b/spider.bmp index 4c7be4e..c013903 100644 Binary files a/spider.bmp and b/spider.bmp differ diff --git a/spidercaught.bmp b/spidercaught.bmp index 7921af7..187ae1f 100644 Binary files a/spidercaught.bmp and b/spidercaught.bmp differ diff --git a/spiderfall.bmp b/spiderfall.bmp index 3f992b4..bc15041 100644 Binary files a/spiderfall.bmp and b/spiderfall.bmp differ diff --git a/spiderjump.bmp b/spiderjump.bmp index 0a4e0d9..6d7906e 100644 Binary files a/spiderjump.bmp and b/spiderjump.bmp differ diff --git a/svn-commit.tmp b/svn-commit.tmp deleted file mode 100644 index 2d0dca9..0000000 --- a/svn-commit.tmp +++ /dev/null @@ -1,37 +0,0 @@ -initial checkin ---This line, and those below, will be ignored-- - -AM full.bmp -AM sky.bmp -A emptylevel -AM slopedown.bmp -AM right.bmp -AM laddertop.bmp -A level1.dat -AM blank.bmp -AM pdwarf.png -A Makefile.windows -AM pjump.bmp -AM ladder.bmp -AM player.bmp -AM cheese.bmp -AM pfall.bmp -A Makefile -A level.dat -AM ratdead.bmp -AM dwarf.jpg -A rc.c -A rc.h -AM land.bmp -AM ratcaught.bmp -A greentiles -AM pdwarfjump.png -AM rat.bmp -AM oldblank.bmp -A tiles.conf -AM slopeup.bmp -AM pdwarffall.png -A testlevel -AM left.bmp -AM spikes.bmp -A Makefile.posix