- bugfix: move sprites away from walls when jumping/swimming to avoid getting stuck

- bugfix: don't trigger trampolines while moving to new nevel
- bugfix: clock powerup should turn off when you win the level
- tweak: don't create flipped/angry images for fruits or effects
- feature: new powerup - snowman. turns level and monsters to ice
- feature: new tiles: ice, icetop
- feature: new sprite image: icecube (used for freezing monsters)
This commit is contained in:
Rob Pearce 2008-10-03 11:11:07 +00:00
parent 55ce7e640f
commit 053262ff2c
16 changed files with 292 additions and 64 deletions

26
defs.h
View File

@ -70,6 +70,10 @@
#define LEVELH 30 // level height (in tiles) #define LEVELH 30 // level height (in tiles)
// ice effect
#define ICE_NONE 0
#define ICE_INPROGRESS 1
#define ICE_COMPLETE 2
// Game mechanics // Game mechanics
@ -79,6 +83,9 @@
#define NETSPEED 9 // how fast the player's net moves #define NETSPEED 9 // how fast the player's net moves
#define POWERUPTIME 15 // # secs before a powerup appears #define POWERUPTIME 15 // # secs before a powerup appears
#define ICESPEED 2 // how fast a level turns to ice
#define BELLTIME 20 // how long the bell flash lasts #define BELLTIME 20 // how long the bell flash lasts
#define CLOCKTIME 10 // how many seconds a clock lasts #define CLOCKTIME 10 // how many seconds a clock lasts
@ -117,7 +124,7 @@
/* enums */ /* enums */
/* sounds */ /* sounds */
#define MAXFX 24 #define MAXFX 26
#define FX_SHOOT 0 #define FX_SHOOT 0
#define FX_SLAM 1 #define FX_SLAM 1
#define FX_KILL 2 #define FX_KILL 2
@ -142,6 +149,8 @@
#define FX_BELL 21 #define FX_BELL 21
#define FX_CLOCK 22 #define FX_CLOCK 22
#define FX_ARMOR 23 #define FX_ARMOR 23
#define FX_FREEZE 24
#define FX_ICEBREAK 25
// Slope types // Slope types
#define S_NOTSOLID 0 #define S_NOTSOLID 0
@ -149,7 +158,7 @@
#define S_SLOPE 2 #define S_SLOPE 2
// Sprite types // Sprite types
#define MAXPTYPES 43 #define MAXPTYPES 44
#define P_PLAYER 0 #define P_PLAYER 0
#define P_RAT 1 #define P_RAT 1
#define P_CHEESE 2 #define P_CHEESE 2
@ -193,6 +202,7 @@
#define P_SPARKLE 40 #define P_SPARKLE 40
#define P_BELL 41 #define P_BELL 41
#define P_CLOCK 42 #define P_CLOCK 42
#define P_SNOWMAN 43
// powerups // powerups
#define PW_NONE 0 #define PW_NONE 0
@ -233,6 +243,11 @@
#define LV_NEXTLEV 4 // end of delay, nextlevel() in 5 seconds #define LV_NEXTLEV 4 // end of delay, nextlevel() in 5 seconds
#define LV_GAMEOVER 6 // No lives left. #define LV_GAMEOVER 6 // No lives left.
// movement types
#define MV_NONE 0 // didn't move
#define MV_WALK 1 // walked/climbed on purpose
#define MV_ICE 3 // slid on ice
// Tile types // Tile types
#define T_BLANK 0 #define T_BLANK 0
@ -255,6 +270,8 @@
#define T_BRIDGE 17 // like land but you can drop down through it #define T_BRIDGE 17 // like land but you can drop down through it
#define T_TRAMPUP 18 #define T_TRAMPUP 18
#define T_TRAMPDOWN 19 #define T_TRAMPDOWN 19
#define T_ICETOP 20 // slippery
#define T_ICE 21 // slippery
// death states // death states
#define D_INITIAL (1) // Need to trigger death sequence #define D_INITIAL (1) // Need to trigger death sequence
@ -343,6 +360,7 @@ typedef struct level_s {
initialmonster_t initm[MAXMONSTERSPERLEVEL]; initialmonster_t initm[MAXMONSTERSPERLEVEL];
int hurryuptime; int hurryuptime;
int poweruptime; int poweruptime;
int icey,iced; // for ice powerups
} level_t; } level_t;
level_t *level; level_t *level;
@ -390,6 +408,8 @@ typedef struct sprite_s {
int hasbell; // got a bell ? int hasbell; // got a bell ?
// monster only // monster only
int iced; // turned to ice?
SDL_Surface *iceimg; // Image to blit for ice
int willbecome; // what fruit this will become when dead int willbecome; // what fruit this will become when dead
int angry; // is this sprite in ANGRY mode for its AI? int angry; // is this sprite in ANGRY mode for its AI?
struct sprite_s *caughtby; // who has us in their net? NULL if nobody struct sprite_s *caughtby; // who has us in their net? NULL if nobody
@ -440,7 +460,7 @@ imageset_t imageset[MAXPTYPES];
/* external globals */ /* external globals */
extern SDL_Color black; extern SDL_Color black;
extern SDL_Surface *screen, *temps, *levelbg, *head, *headsmall; extern SDL_Surface *screen, *temps, *levelbg, *head, *headsmall, *icecube;
extern sprite_t *sprite, *lastsprite, *player; extern sprite_t *sprite, *lastsprite, *player;
extern level_t *curlevel; extern level_t *curlevel;
extern tiletype_t fakeblock; extern tiletype_t fakeblock;

View File

@ -11,6 +11,7 @@ SDL_Surface *levelbg; // level background image
SDL_Surface *temps; // temporary surface SDL_Surface *temps; // temporary surface
SDL_Surface *screen; // the actual video screen SDL_Surface *screen; // the actual video screen
SDL_Surface *head,*headsmall; // img in corner showing number of lives SDL_Surface *head,*headsmall; // img in corner showing number of lives
SDL_Surface *icecube; // overlaid on frozen monsters
sprite_t *sprite; // head of sprite linked list sprite_t *sprite; // head of sprite linked list
sprite_t *lastsprite; // tail of sprite linked list sprite_t *lastsprite; // tail of sprite linked list
sprite_t *player; // pointer to the player's sprite sprite_t *player; // pointer to the player's sprite

View File

@ -199,10 +199,21 @@ solid 0
file newtiles/signdown.png file newtiles/signdown.png
end end
tile trampolinedown tile trampolinedown
id 19 id 19
solid 2 solid 2
file newtiles/trampdown.png file newtiles/trampdown.png
lowness 9,9,8,8,8,8,8,8,8,8,8,8,8,8,9,9 lowness 9,9,8,8,8,8,8,8,8,8,8,8,8,8,9,9
end end
tile icetop
id 20
solid 1
file newtiles/icetop.png
end
tile ice
id 21
solid 1
file newtiles/ice.png
end

BIN
newtiles/ice.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 591 B

BIN
newtiles/icetop.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 638 B

204
rc.c
View File

@ -255,7 +255,7 @@ int main (int argc, char **argv) {
/* check for death & update movement status*/ /* check for death & update movement status*/
for (s = sprite ; s ; s = nextsprite) { for (s = sprite ; s ; s = nextsprite) {
s->moved = B_FALSE; s->moved = MV_NONE;
nextsprite = s->next; nextsprite = s->next;
if (s->dead == D_FINAL) { if (s->dead == D_FINAL) {
if (s == player) { if (s == player) {
@ -291,6 +291,11 @@ int main (int argc, char **argv) {
addoutlinetext(320,240,TEXTSIZE_LEVEL,"Level Complete!",&green,&black,LEVELWINDELAY); addoutlinetext(320,240,TEXTSIZE_LEVEL,"Level Complete!",&green,&black,LEVELWINDELAY);
levelcomplete = LV_WAIT; levelcomplete = LV_WAIT;
playfx(FX_WINLEVEL); playfx(FX_WINLEVEL);
// turn off clock powerup
if (player->powerup == PW_CLOCK) {
Mix_ResumeMusic();
player->powerup = B_FALSE;
}
} else if (levelcomplete == LV_WAIT) { } else if (levelcomplete == LV_WAIT) {
int mcount = 0; int mcount = 0;
sprite_t *s2; sprite_t *s2;
@ -387,7 +392,7 @@ int main (int argc, char **argv) {
player->jumping = 0; player->jumping = 0;
player->falling = 0; player->falling = 0;
player->climbing = B_TRUE; player->climbing = B_TRUE;
player->moved = B_TRUE; player->moved = MV_WALK;
} }
} }
} }
@ -398,7 +403,7 @@ int main (int argc, char **argv) {
player->jumping = 0; player->jumping = 0;
player->falling = 0; player->falling = 0;
player->climbing = B_TRUE; player->climbing = B_TRUE;
player->moved = B_TRUE; player->moved = MV_WALK;
} }
} }
} }
@ -557,6 +562,11 @@ int main (int argc, char **argv) {
} }
} }
// ice effect
if (curlevel->iced == ICE_INPROGRESS) {
doice();
}
} }
// move sprites // move sprites
@ -571,14 +581,16 @@ int main (int argc, char **argv) {
dogravity(player); dogravity(player);
dotileeffects(player); dotileeffects(player);
} else { } else {
/* gravity */ if (levelcomplete != LV_NEXTLEV) {
for (s = sprite ; s ; s = s->next) { /* gravity */
dogravity(s); for (s = sprite ; s ; s = s->next) {
} dogravity(s);
}
/* tile effects */ /* tile effects */
for (s = sprite ; s ; s = s->next) { for (s = sprite ; s ; s = s->next) {
dotileeffects(s); dotileeffects(s);
}
} }
} }
@ -736,6 +748,7 @@ void tick(void) {
for (s = sprite; s; s = s->next) { for (s = sprite; s; s = s->next) {
if ((s != player) && (ismonster(s->id))) { if ((s != player) && (ismonster(s->id))) {
s->angry = B_TRUE; s->angry = B_TRUE;
s->iced = B_FALSE;
} }
} }
addoutlinetext(320,240,TEXTSIZE_HURRY, "Hurry up!", &yellow,&black,HURRYDELAY); addoutlinetext(320,240,TEXTSIZE_HURRY, "Hurry up!", &yellow,&black,HURRYDELAY);
@ -824,6 +837,9 @@ void nextlevel(void) {
playedbell = BELL_DONEFLASH; playedbell = BELL_DONEFLASH;
} }
level->iced = ICE_NONE;
level->icey = -1;
sprintf(msg, "Level %d-%d",curworld, curlevelnum); sprintf(msg, "Level %d-%d",curworld, curlevelnum);
addoutlinetext(320,240-18,TEXTSIZE_LEVEL,msg,&white,&black,LEVELDELAY); addoutlinetext(320,240-18,TEXTSIZE_LEVEL,msg,&white,&black,LEVELDELAY);
@ -893,6 +909,9 @@ void jump(sprite_t *s, int dir) {
playfx(FX_JUMP); playfx(FX_JUMP);
} }
} }
adjustx(s, F_JUMP);
} }
} }
@ -953,10 +972,21 @@ void die(sprite_t *s) {
s2->angry = B_TRUE; s2->angry = B_TRUE;
} }
} }
// un-ice everything
if (s == player) {
for (s2 = sprite->next ; s2 ; s2 = s2->next) {
if (s2->iced) {
s2->iced = B_FALSE;
}
}
}
/* set death attribute */ /* set death attribute */
s->dead = D_INITIAL; s->dead = D_INITIAL;
s->netting = 0; s->netting = 0;
s->slamming = 0; s->slamming = 0;
s->iced = 0;
// check for level clear // check for level clear
countmonsters(); countmonsters();
@ -1060,8 +1090,13 @@ void checkcollide(sprite_t *s) {
addoutlinetext(s2->x,s2->y - s->img->h/2, TEXTSIZE_BIFF, tempm,&red,&yellow,POINTSDELAY); addoutlinetext(s2->x,s2->y - s->img->h/2, TEXTSIZE_BIFF, tempm,&red,&yellow,POINTSDELAY);
keepchecking = B_FALSE; keepchecking = B_FALSE;
} else if (s2->iced) {
// it dies
playfx(FX_ICEBREAK);
die(s2);
} else { } else {
// otherwise we caught it if we have enough nets // otherwise we caught it if we have enough nets
if (s->netcaught < s->netmax) { if (s->netcaught < s->netmax) {
s2->caughtby = s; s2->caughtby = s;
s2->jumping = B_FALSE; s2->jumping = B_FALSE;
@ -1107,7 +1142,12 @@ void checkcollide(sprite_t *s) {
addoutlinetext(s2->x,s2->y - s2->img->h/2, TEXTSIZE_POINTS, tempm, &white,&black,POINTSDELAY); addoutlinetext(s2->x,s2->y - s2->img->h/2, TEXTSIZE_POINTS, tempm, &white,&black,POINTSDELAY);
} }
} else if (ismonster(s2->id) || isbullet(s2->id)) { } else if (ismonster(s2->id) || isbullet(s2->id)) {
if (!s->invuln) { if (s2->iced) {
// monster dies
playfx(FX_ICEBREAK);
die(s2);
} else if (!s->invuln) {
// player dies
die(s); die(s);
} }
} }
@ -1182,6 +1222,11 @@ void movesprite(sprite_t *s) {
} }
} }
// iced monsters can't move
if (ismonster(s->id) && s->iced) {
return;
}
/* timer */ /* timer */
if (s->doomcount) { if (s->doomcount) {
s->doomcount--; s->doomcount--;
@ -1742,7 +1787,7 @@ void movesprite(sprite_t *s) {
s->x += s->xs; s->x += s->xs;
s->y += s->ys; s->y += s->ys;
s->dir = absxs; s->dir = absxs;
s->moved = B_TRUE; s->moved = MV_WALK;
} else if (s->id == P_SPIDER) { } else if (s->id == P_SPIDER) {
/* timer1 loopsfrom 0 - 45 /* timer1 loopsfrom 0 - 45
@ -1931,6 +1976,16 @@ void dotileeffects(sprite_t *s) {
} }
} }
finished = B_TRUE; finished = B_TRUE;
} else if ((tt->id == T_ICE) || (tt->id == T_ICETOP)) {
if (s == player) {
if (player->powerup != PW_CLOCK) {
if (!s->moved) {
movex(s, s->dir*s->speed);
s->moved = MV_ICE;
}
}
}
finished = B_TRUE;
} else if (tt->spikes) { } else if (tt->spikes) {
if (!isfruit(s->id) && !iseffect(s->id) && !isbullet(s->id)) { if (!isfruit(s->id) && !iseffect(s->id) && !isbullet(s->id)) {
if (!s->invuln) { if (!s->invuln) {
@ -2689,11 +2744,13 @@ int isonground(sprite_t *s) {
return B_TRUE; return B_TRUE;
} }
if ((s->dead) || (!s->falling && !s->dropping)) { if ((s->dead) || (!s->falling && !s->dropping)) {
if (isongroundpoint(s, s->x + s->img->w/2, s->y)) { if (!s->swimming) {
return B_TRUE; if (isongroundpoint(s, s->x + s->img->w/2, s->y)) {
} return B_TRUE;
if (isongroundpoint(s, s->x - s->img->w/2, s->y)) { }
return B_TRUE; if (isongroundpoint(s, s->x - s->img->w/2, s->y)) {
return B_TRUE;
}
} }
} }
@ -2793,7 +2850,7 @@ void dogravity(sprite_t *s) {
if (s->dead) return; if (s->dead) return;
if (s->flies) return; if (s->flies && !s->iced) return; // ice cancels flying
if (iseffect(s->id)) return; if (iseffect(s->id)) return;
if (isbullet(s->id)) return; if (isbullet(s->id)) return;
@ -2806,11 +2863,17 @@ void dogravity(sprite_t *s) {
} }
*/ */
// iced sprites can't jump
if (s->iced) {
s->jumping = B_FALSE;
}
// update water stats // update water stats
if (isinwater(s)) { if (isinwater(s)) {
if (!s->swimming) { if (!s->swimming) {
s->swimming = B_TRUE; s->swimming = B_TRUE;
playfx(FX_SPLASH); playfx(FX_SPLASH);
adjustx(s, F_SWIM1);
} }
} else { } else {
if (s->swimming) { if (s->swimming) {
@ -2885,6 +2948,12 @@ void dogravity(sprite_t *s) {
} else { // not jumping } else { // not jumping
if (isonground(s) ) { if (isonground(s) ) {
if (s->falling && s->iced) {
// when an iced monster hits the ground, it smashes
s->willbecome = P_DIAMOND;
playfx(FX_ICEBREAK);
die(s);
}
s->dropping = B_FALSE; s->dropping = B_FALSE;
s->falling = B_FALSE; s->falling = B_FALSE;
s->climbing = B_FALSE; s->climbing = B_FALSE;
@ -2893,7 +2962,7 @@ void dogravity(sprite_t *s) {
s->fallspeed = 1; s->fallspeed = 1;
} }
s->falling = B_TRUE; s->falling = B_TRUE;
if (isinwater(s)) { if (isinwater(s) && !s->iced) {
s->y += (s->fallspeed/2); s->y += (s->fallspeed/2);
} else { } else {
s->y += s->fallspeed; s->y += s->fallspeed;
@ -3137,8 +3206,8 @@ int movex(sprite_t *s,double amt) {
cury = s->y; cury = s->y;
/* check for blockage to E/W */ /* check for blockage to E/W */
//newx = s->x + (amtdir*(s->img->w/2)); newx = s->x + (amtdir*(s->img->w/2)) ;
newx = s->x + (amtdir*TILEW/2); //newx = s->x + (amtdir*TILEW/2);
newy = cury-TILEH; newy = cury-TILEH;
tt2 = gettileat(newx,newy,&newtilex,&newtiley); tt2 = gettileat(newx,newy,&newtilex,&newtiley);
if (tt2->solid == S_SOLID) { if (tt2->solid == S_SOLID) {
@ -3179,7 +3248,7 @@ int movex(sprite_t *s,double amt) {
s->x += amt; s->x += amt;
} }
s->moved = B_TRUE; s->moved = MV_WALK;
// rings // rings
if (s == player) { if (s == player) {
@ -3398,6 +3467,16 @@ int dofruiteffect(sprite_t *s) {
// pause music // pause music
Mix_PauseMusic(); Mix_PauseMusic();
return B_TRUE; return B_TRUE;
} else if (s->id == P_SNOWMAN) {
// ice
playfx(FX_FREEZE);
sprintf(tempm, "Blizzard!");
addoutlinetext(s->x,s->y - s->img->h/2, TEXTSIZE_POINTS, tempm,&white,&black,POINTSDELAY);
if (!curlevel->iced) {
curlevel->iced = ICE_INPROGRESS;
curlevel->icey = 0;
}
return B_TRUE;
} else if (s->id == P_BOMB) { } else if (s->id == P_BOMB) {
sprite_t *s2, *nexts; sprite_t *s2, *nexts;
@ -3564,6 +3643,8 @@ int initsound(void) {
loadfx(FX_BELL, "bell.wav"); loadfx(FX_BELL, "bell.wav");
loadfx(FX_CLOCK, "clock.wav"); loadfx(FX_CLOCK, "clock.wav");
loadfx(FX_ARMOR, "armor.wav"); loadfx(FX_ARMOR, "armor.wav");
loadfx(FX_FREEZE, "freeze.wav");
loadfx(FX_ICEBREAK, "icebreak.wav");
// load sound effects // load sound effects
@ -3741,3 +3822,82 @@ void addscore(sprite_t *s, int amt) {
} }
} }
} }
void doice(void) {
int yy,xx,changed;
sprite_t *s;
// just in case
if (!curlevel->iced) {
curlevel->iced = ICE_INPROGRESS;
}
// slowly change a level to ice
//if (timer % ICESPEED == 0) {
xx = 0;
for (yy = curlevel->icey; yy >= 0; yy--) {
// finished?
if ((xx == LEVELW-1) && (yy == LEVELH-1)) {
curlevel->iced = ICE_COMPLETE;
break;
}
// make sure tile is valid
if ((yy >= 0) && (yy < LEVELH) && (xx >= 0) && (xx < LEVELW)) {
changed = B_FALSE;
// if not already a second layer here...
if (curlevel->map2[yy*LEVELW+xx] == T_BLANK) {
// add ice layer
switch (curlevel->map[yy*LEVELW+xx] ) {
case T_FULL:
curlevel->map2[yy*LEVELW+xx] = getuniq(T_ICE);
changed = B_TRUE;
break;
case T_LAND:
curlevel->map2[yy*LEVELW+xx] = getuniq(T_ICETOP);
changed = B_TRUE;
break;
}
if (changed) {
drawtile(temps, xx, yy);
}
}
}
xx++;
if (xx >= LEVELW) break;
}
// ice any monsters
for (s = sprite; s ; s = s->next) {
if (ismonster(s->id)) {
if ((s->x <= (xx*TILEW)) && (s->y <= (curlevel->icey*TILEH))) {
if (!s->iced && !s->dead && !s->caughtby) {
// ice it!
s->iced = B_TRUE;
s->jumping = B_FALSE;
}
}
}
}
// increase icey for next time
curlevel->icey++;
}
void adjustx(sprite_t *s,int framenum) {
int newx,newy,diff;
tiletype_t *tt;
diff = (imageset[s->id].img[framenum]->w - s->img->w) +1 ;
newy = s->y-TILEH;
// check RIGHT
newx = s->x + (s->img->w/2);
tt = gettileat(newx,newy,NULL,NULL);
if (tt->solid == S_SOLID) {
s->x -= diff;
}
// check LEFT
newx = s->x - (s->img->w/2);
tt = gettileat(newx,newy,NULL,NULL);
if (tt->solid == S_SOLID) {
s->x += diff;
}
}

3
rc.h
View File

@ -30,6 +30,7 @@ void nextlevel(void);
void jump(sprite_t *s, int dir); void jump(sprite_t *s, int dir);
double getspeed(sprite_t *s ); double getspeed(sprite_t *s );
void adjustheight(sprite_t *s); void adjustheight(sprite_t *s);
void adjustx(sprite_t *s, int newframe);
void tick(void); void tick(void);
void usage(void); void usage(void);
int canmove(sprite_t *pl); int canmove(sprite_t *pl);
@ -48,3 +49,5 @@ int getpoints(int id);
int isladder(int tid); int isladder(int tid);
char *addcommas(char *buffer, int num); char *addcommas(char *buffer, int num);
void addscore(sprite_t *s, int amt); void addscore(sprite_t *s, int amt);
void doice(void);

View File

@ -725,6 +725,11 @@ void setdefaults(sprite_t *s) {
s->dead = 0; s->dead = 0;
s->angry = 0; s->angry = 0;
s->jumptimer = 0; s->jumptimer = 0;
s->iced = B_FALSE;
if (s->iceimg) {
SDL_FreeSurface(s->iceimg);
s->iceimg = NULL;
}
s->bullet = NULL; s->bullet = NULL;
s->owner = NULL; s->owner = NULL;
@ -795,6 +800,7 @@ sprite_t *addsprite(int id, int x, int y, char *name ) {
} else { } else {
s->netbg = NULL; s->netbg = NULL;
} }
s->iceimg = NULL;
setdefaults(s); setdefaults(s);
@ -812,6 +818,7 @@ sprite_t *addsprite(int id, int x, int y, char *name ) {
} }
#endif #endif
s->next = NULL; s->next = NULL;
lastsprite = s; lastsprite = s;
@ -1015,6 +1022,7 @@ int loadimagesets(void) {
head = IMG_Load("sprites/dwarfhead.png"); head = IMG_Load("sprites/dwarfhead.png");
headsmall = IMG_Load("sprites/dwarfhead-small.png"); headsmall = IMG_Load("sprites/dwarfhead-small.png");
icecube = IMG_Load("sprites/icecube.png");
loadspriteimage(P_PLAYER,F_WALK1, "sprites/pdwarf.png"); loadspriteimage(P_PLAYER,F_WALK1, "sprites/pdwarf.png");
loadspriteimage(P_PLAYER,F_JUMP, "sprites/pdwarfjump.png"); loadspriteimage(P_PLAYER,F_JUMP, "sprites/pdwarfjump.png");
@ -1196,6 +1204,9 @@ int loadimagesets(void) {
loadspriteimage(P_CLOCK,F_WALK1, "sprites/clock.png"); loadspriteimage(P_CLOCK,F_WALK1, "sprites/clock.png");
imageset[P_CLOCK].numimages = 1; imageset[P_CLOCK].numimages = 1;
loadspriteimage(P_SNOWMAN,F_WALK1, "sprites/snowman.png");
imageset[P_SNOWMAN].numimages = 1;
// puffs and mace smashes // puffs and mace smashes
for (i = 0; i < PUFFFRAMES; i++) { for (i = 0; i < PUFFFRAMES; i++) {
char name[SMALLBUFLEN]; char name[SMALLBUFLEN];
@ -1373,6 +1384,8 @@ void drawsprite(sprite_t *s) {
} }
} else if (s->netting) { } else if (s->netting) {
frame = F_SHOOT; frame = F_SHOOT;
} else if (s->iced) {
frame = F_WALK1;
} else if (s->jumping) { } else if (s->jumping) {
frame = F_JUMP; frame = F_JUMP;
} else if (s->falling) { } else if (s->falling) {
@ -1394,12 +1407,15 @@ void drawsprite(sprite_t *s) {
if ((s->id == P_SPIDER) && (s->ys != -99)) { if ((s->id == P_SPIDER) && (s->ys != -99)) {
frame = F_FALL; frame = F_FALL;
} else { } else {
if (s->moved) { // walking / sliding
if (s->moved == MV_WALK) {
if ((timer/12) % 2 == 0) { if ((timer/12) % 2 == 0) {
frame = F_WALK1; frame = F_WALK1;
} else { } else {
frame = F_JUMP; frame = F_JUMP;
} }
} else if (s->moved == MV_ICE) {
frame = F_FALL;
} else { } else {
frame = F_WALK1; frame = F_WALK1;
} }
@ -1425,7 +1441,7 @@ void drawsprite(sprite_t *s) {
/* spider's climbing web */ /* spider's climbing web */
if ((s->id == P_SPIDER) && ((s->ys != -99) || s->falling) && (!s->dead) && (!s->caughtby)) { if ((s->id == P_SPIDER) && ((s->ys != -99) || s->falling) && !s->dead && !s->caughtby && !s->iced) {
tiletype_t *tt; tiletype_t *tt;
int x = s->x; int x = s->x;
int y = s->y - s->img->h/2; int y = s->y - s->img->h/2;
@ -1453,13 +1469,29 @@ void drawsprite(sprite_t *s) {
SDL_BlitSurface(s->img, NULL, screen, &area); SDL_BlitSurface(s->img, NULL, screen, &area);
} }
} else { } else {
// draw the sprite
SDL_BlitSurface(s->img, NULL, screen, &area); SDL_BlitSurface(s->img, NULL, screen, &area);
/* for opengl */ /* for opengl */
//SDL_UpdateRect(screen, area.x, area.y, area.w, area.h); //SDL_UpdateRect(screen, area.x, area.y, area.w, area.h);
} }
// ice cube
if (s->iced) {
if (!s->iceimg) {
double xmod,ymod;
xmod = (double)s->img->w / (double)icecube->w;
ymod = (double)s->img->h / (double)icecube->h;
// create image
s->iceimg = rotozoomSurfaceXY(icecube,0, xmod, ymod ,0);
}
// draw it
SDL_BlitSurface(s->iceimg, NULL, screen, &area);
}
} }
/* caughtby lines */ /* caughtby lines */
if ((s->caughtby) && (s->caughtstate == 2)){ if ((s->caughtby) && (s->caughtstate == 2)){
drawline16(screen, s->x,s->y - s->img->h, drawline16(screen, s->x,s->y - s->img->h,
@ -1488,6 +1520,11 @@ void killsprite(sprite_t *s) {
} }
} }
// free ice image
if (s->iceimg) {
SDL_FreeSurface(s->iceimg);
}
nextone = s->next; nextone = s->next;
if (nextone != NULL) { if (nextone != NULL) {
nextone->prev = s->prev; nextone->prev = s->prev;
@ -1580,6 +1617,7 @@ int isfruit(int id) {
case P_RINGSILVER: case P_RINGSILVER:
case P_RINGGOLD: case P_RINGGOLD:
case P_CLOCK: case P_CLOCK:
case P_SNOWMAN:
/* flowers */ /* flowers */
case P_FLOWERYELLOW: case P_FLOWERYELLOW:
case P_FLOWERRED: case P_FLOWERRED:
@ -2091,7 +2129,7 @@ int loadlevellist(void) {
int randompowerup(void) { int randompowerup(void) {
int num; int num;
num = rand() % 16; num = rand() % 17;
switch (num) { switch (num) {
case 0: case 0:
@ -2127,6 +2165,8 @@ int randompowerup(void) {
return P_BELL; return P_BELL;
case 15: case 15:
return P_CLOCK; return P_CLOCK;
case 16:
return P_SNOWMAN;
} }
} }

BIN
sounds/freeze.wav Normal file

Binary file not shown.

BIN
sounds/icebreak.wav Normal file

Binary file not shown.

BIN
sprites/icecube.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

BIN
sprites/snowman.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -1,4 +1,4 @@
tileset green bgfile
bg 0 bg 0
hurryup 232 hurryup 232
endmaps endmaps
@ -62,20 +62,20 @@ exitdir 1
24,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,24, 24,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,24,
24,20,20,20,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,24, 24,20,20,20,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,24,
24,0,0,0,0,0,0,25,25,25,25,25,25,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,20,20,20,24, 24,0,0,0,0,0,0,25,25,25,25,25,25,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,20,20,20,24,
24,0,0,0,0,0,24,24,26,26,26,26,24,24,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,24, 24,0,0,0,0,0,25,24,26,26,26,26,24,25,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,24,
24,0,0,0,0,24,24,26,26,26,26,26,26,24,24,0,0,0,0,0,0,0,0,0,0,0,25,25,25,25,25,25,25,0,0,0,0,0,0,24, 24,0,0,0,0,25,24,26,26,26,26,26,26,24,25,0,0,0,0,0,0,0,0,0,0,0,25,25,25,25,25,25,25,0,0,0,0,0,0,24,
24,20,0,0,24,24,26,26,26,26,26,26,26,26,24,24,24,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,24, 24,20,0,0,25,24,26,26,26,26,26,26,26,26,24,25,25,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,24,
24,0,0,24,24,26,26,26,26,26,26,26,26,26,26,26,26,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24, 24,0,0,25,24,26,26,26,26,26,26,26,26,26,26,26,26,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,
24,0,0,24,24,26,26,26,26,26,26,26,26,26,26,26,26,0,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24, 24,0,0,24,24,26,26,26,26,26,26,26,26,26,26,26,26,0,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,
24,20,0,24,24,26,26,26,26,26,26,26,26,26,26,25,25,20,20,20,20,20,20,20,20,20,25,25,25,25,25,25,25,0,0,0,0,0,20,24, 24,20,0,24,24,26,26,26,26,26,26,26,26,26,26,25,25,20,20,20,20,20,20,20,20,20,25,25,25,25,25,25,25,0,0,0,0,0,20,24,
24,0,0,0,24,25,26,26,26,26,26,26,26,26,25,24,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24, 24,0,0,0,24,25,26,26,26,26,26,26,26,26,25,24,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,
24,0,0,0,0,24,25,26,26,26,26,26,26,25,24,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24, 24,0,0,0,0,24,25,26,26,26,26,26,26,25,24,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,
24,20,0,0,0,0,24,25,26,26,26,26,25,24,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,24, 24,20,0,0,0,0,24,25,26,26,26,26,25,24,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,24,
24,0,0,0,0,0,0,24,26,26,26,26,24,0,0,0,0,0,0,0,0,0,0,0,0,0,25,25,25,25,25,25,0,0,0,0,0,0,0,24, 24,0,0,0,0,0,0,24,26,26,26,26,24,0,0,0,0,0,0,0,0,0,0,0,0,0,25,25,25,25,25,25,0,0,0,0,0,0,0,24,
24,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,24,26,26,26,26,24,24,0,0,0,0,0,0,24, 24,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,25,24,26,26,26,26,24,25,0,0,0,0,0,0,24,
24,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,24,26,26,26,26,26,26,24,24,0,0,0,0,20,24, 24,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,25,24,26,26,26,26,26,26,24,25,0,0,0,0,20,24,
24,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,24,26,26,26,26,26,26,26,26,24,24,0,0,0,0,24, 24,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,25,24,26,26,26,26,26,26,26,26,24,25,0,0,0,0,24,
24,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,24,26,26,26,26,26,26,26,26,26,26,24,24,0,0,0,24, 24,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,25,24,26,26,26,26,26,26,26,26,26,26,24,25,0,0,0,24,
24,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,26,26,26,26,26,26,26,26,26,26,26,26,26,26,0,0,20,24, 24,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,26,26,26,26,26,26,26,26,26,26,26,26,26,26,0,0,20,24,
24,0,0,0,0,0,0,29,0,17,17,0,29,0,0,0,0,0,0,0,5,0,26,26,26,26,26,26,26,26,26,26,26,26,26,26,0,0,0,24, 24,0,0,0,0,0,0,29,0,17,17,0,29,0,0,0,0,0,0,0,5,0,26,26,26,26,26,26,26,26,26,26,26,26,26,26,0,0,0,24,
24,0,0,0,0,0,0,25,25,25,25,25,25,20,20,20,20,20,20,20,20,20,25,25,25,26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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,

View File

@ -5,6 +5,7 @@ endmaps
help help
endhelp endhelp
monsters monsters
1 20 12
! 20 12 ! 20 12
@ 11 5 @ 11 5
@ 12 9 @ 12 9
@ -26,7 +27,6 @@ P 29 19
P 30 15 P 30 15
P 9 15 P 9 15
S 7 5 S 7 5
Y 1 15
Y 11 9 Y 11 9
Y 13 9 Y 13 9
Y 26 9 Y 26 9
@ -35,7 +35,6 @@ Y 3 15
Y 30 28 Y 30 28
Y 32 28 Y 32 28
Y 36 15 Y 36 15
Y 38 15
Y 4 28 Y 4 28
Y 6 28 Y 6 28
a 31 3 a 31 3
@ -46,7 +45,6 @@ r 10 12
r 29 12 r 29 12
r 6 15 r 6 15
r 31 15 r 31 15
1 20 12
endmonsters endmonsters
exitdir 2 exitdir 2
4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4, 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
@ -65,7 +63,7 @@ exitdir 2
4,0,0,0,0,0,0,0,0,0,1,1,1,1,1,0,0,0,0,20,20,20,0,0,0,1,1,1,1,1,0,0,0,0,0,0,0,0,0,4, 4,0,0,0,0,0,0,0,0,0,1,1,1,1,1,0,0,0,0,20,20,20,0,0,0,1,1,1,1,1,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,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