- Added black border around cards

- Flood effect (tap) now times out after 20 seconds to avoid getting stuck
- Clock timer now does not display during poker effect
This commit is contained in:
Rob Pearce 2008-10-17 02:05:54 +00:00
parent 1d1046d8db
commit 79ac13691a
7 changed files with 86 additions and 18 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 251 B

After

Width:  |  Height:  |  Size: 267 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 224 B

After

Width:  |  Height:  |  Size: 242 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 225 B

After

Width:  |  Height:  |  Size: 233 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 236 B

After

Width:  |  Height:  |  Size: 252 B

96
rc.c
View File

@ -32,6 +32,10 @@ Mix_Music *curmusic = NULL; // pointer to currently playing music
char tempm[BUFLEN];
// used to remember old level if we flood it
int savemap[LEVELW*LEVELH];
int watertime;
int playedbell;
int clocktime;
@ -285,10 +289,13 @@ int main (int argc, char **argv) {
addoutlinetext(320,240,TEXTSIZE_LEVEL,"Level Complete!",&green,&black,LEVELWINDELAY);
levelcomplete = LV_WAIT;
playfx(FX_WINLEVEL);
// turn off clock powerup
// turn off clock and water powerups
if (player->powerup == PW_CLOCK) {
Mix_ResumeMusic();
player->powerup = B_FALSE;
} else if ((curlevel->iced == WATER_INPROGRESS) || (curlevel->iced == WATER_COMPLETE)) {
curlevel->iced = B_FALSE;
undoflood();
}
} else if (levelcomplete == LV_WAIT) {
int mcount = 0;
@ -642,27 +649,49 @@ void tick(void) {
gtime++;
// handle clock effect
if (player->powerup == PW_CLOCK) {
char tempm[SMALLBUFLEN];
// text
if (clocktime > 0) {
sprintf(tempm, "%d",clocktime);
addoutlinetext(320,120,TEXTSIZE_LEVEL, tempm, &yellow,&black,15);
// sound effect
playfx(FX_CLOCK);
if (levelcomplete == LV_INPROGRESS) {
if (player->powerup == PW_CLOCK) {
char tempm[SMALLBUFLEN];
// text
if (clocktime > 0) {
sprintf(tempm, "%d",clocktime);
addoutlinetext(320,120,TEXTSIZE_LEVEL, tempm, &yellow,&black,15);
// sound effect
playfx(FX_CLOCK);
}
// never reach hurryup time
nexthurryup++;
// decrement counter
clocktime--;
if (clocktime < 0) {
// finished!
Mix_ResumeMusic();
player->powerup = B_FALSE;
}
}
// never reach hurryup time
nexthurryup++;
// decrement counter
clocktime--;
if (clocktime < 0) {
// finished!
Mix_ResumeMusic();
player->powerup = B_FALSE;
// handle flood effect
if (curlevel->iced == WATER_COMPLETE) {
char tempm[SMALLBUFLEN];
// text
if (watertime > 0) {
sprintf(tempm, "%d",watertime);
addoutlinetext(320,120,TEXTSIZE_LEVEL, tempm, &cyan,&black,15);
}
// never reach hurryup time
nexthurryup++;
// decrement counter
watertime--;
if (watertime < 0) {
// finished!
curlevel->iced = B_FALSE;
undoflood();
}
}
}
/* check for hurryup*/
if (!isbosslevel(curlevelnum)) {
if (gtime == nexthurryup) {
@ -755,6 +784,7 @@ void tick(void) {
void nextlevel(void) {
char msg[SMALLBUFLEN];
sprite_t *cloudp;
int x,y;
// remove the player
removesprite(player);
@ -779,6 +809,14 @@ void nextlevel(void) {
loadlevel(curworld,curlevelnum, B_TRUE);
}
// remmeber layer 2 in case we replace it with water
for (y = 0 ; y < LEVELH; y++) {
for (x = 0 ; x < LEVELW; x++) {
savemap[y*LEVELW+x] = curlevel->map2[y*LEVELW+x];
}
}
watertime = -1;
// do the moving to next level animation
drawlevel();
@ -1014,6 +1052,14 @@ void die(sprite_t *s) {
}
}
// undo water effect
if (s == player) {
if (curlevel->iced == WATER_COMPLETE) {
undoflood();
curlevel->iced = B_FALSE;
}
}
// boss effects
if (s == boss) {
// stop screen shaking
@ -4712,6 +4758,8 @@ int dofruiteffect(sprite_t *s) {
if (!curlevel->iced) {
curlevel->iced = WATER_INPROGRESS;
curlevel->icey = LEVELH-1;
// water for 20 seconds
watertime = 20;
}
return B_TRUE;
} else if (s->id == P_SNOWMAN) {
@ -5597,7 +5645,7 @@ void getfruit(sprite_t *giveto, sprite_t *fruit, int multiplier) {
}
}
// slowly change leve to water
// slowly change level to water
void doflood(void) {
int yy,xx,changed;
int l2id;
@ -5661,6 +5709,18 @@ void doflood(void) {
}
}
// put flood effect back to normal
void undoflood(void) {
int x,y;
for (y = 0 ; y < LEVELH; y++) {
for (x = 0 ; x < LEVELW; x++) {
curlevel->map2[y*LEVELW+x] = savemap[y*LEVELW+x];
drawtile(temps, x, y);
}
}
}
int haspowerup(sprite_t *s, int pid) {
switch (pid) {

1
rc.h
View File

@ -53,6 +53,7 @@ void addscore(sprite_t *s, int amt);
void extralife(sprite_t *s);
void doice(void);
void doflood(void);
void undoflood(void);
void checklevelend(void);
void checksprites(void);
void moveallsprites(void);

View File

@ -2641,6 +2641,8 @@ void setfruitinfo(void) {
setinfo(P_GEMRED, "Red Gem", "", "gem-red.png");
setinfo(P_GEMPURPLE, "Purple Gem", "", "gem-purple.png");
setinfo(P_FIRSTCARD, "Card", "Keep a look out for these useful items. Collect a full poker hand for a secret bonus!", "cardh.png");
setinfo(P_SPEED, "Speed Up", "Makes you walk faster.", "speed.png");
setinfo(P_NUMNETS, "More Nets", "Increases the number of monsters you can catch simultaneously.", "numnets.png");
@ -2724,6 +2726,11 @@ void dumpinfo(void) {
spriteinfo[i].file, spriteinfo[i].name,spriteinfo[i].desc);
}
}
// card
printf("<tr><td align=center><img src=\"%s\"><br>%s</td><td>%s</td></tr>\n",
spriteinfo[P_FIRSTCARD].file, spriteinfo[P_FIRSTCARD].name,spriteinfo[P_FIRSTCARD].desc);
// temp powerup
printf("<tr><th colspan=2>Temporary Powerups</th></tr>\n");
for (i = 0; i < MAXPTYPES; i++) {