- Modifications to blackcloud behaviour:
Warning smoke is now generated before it appears It now grows smoothly instead of in "steps" It can now go right to the bottom of the screen
This commit is contained in:
parent
552ac3b5e6
commit
f1d23290a0
38
rc.c
38
rc.c
|
@ -552,6 +552,15 @@ int main (int argc, char **argv) {
|
|||
|
||||
|
||||
|
||||
// warning for cloud
|
||||
if ((gtime >= nexthurryup + 10) && (gtime < nexthurryup+15)) { // 15 secs after hurryup
|
||||
if (timer % 4 == 0) {
|
||||
// add puffs
|
||||
puffin(-1, 320 + (rand() % (TILEW*4)) - (TILEW*2),
|
||||
240 + (rand() % (TILEH*2)) - TILEH, "cloudwarn", rand() % 5);
|
||||
}
|
||||
}
|
||||
|
||||
// poker effect
|
||||
// this must come last as it clears the screen and blanks out other sprites
|
||||
if (levelcomplete == LV_DOPOKER) {
|
||||
|
@ -824,7 +833,9 @@ void tick(void) {
|
|||
}
|
||||
} else if (gtime == nexthurryup + 15) { // 15 secs after hurryup
|
||||
if (!levelcomplete) {
|
||||
addsprite(P_BLACKCLOUD, 320,240,"cloud");
|
||||
sprite_t *bc;
|
||||
bc = addsprite(P_BLACKCLOUD, 320,240,"cloud");
|
||||
makeinvuln(bc);
|
||||
addoutlinetext(320,240,TEXTSIZE_HURRY, "Too slow!", &red,&black,HURRYDELAY, TT_NORM);
|
||||
playfx(FX_TOOSLOW);
|
||||
}
|
||||
|
@ -2938,9 +2949,18 @@ if (s->id == P_PUFF) printf("PUFF WITH DOOMCOUNT!\n");
|
|||
s->y--;
|
||||
}
|
||||
} else {
|
||||
if (!s->invuln) {
|
||||
if ((s->xs == -99) || (s->ys == -99)) {
|
||||
if (player->y > s->y) {
|
||||
s->ys = 0.5;
|
||||
} else {
|
||||
s->ys = -0.5;
|
||||
}
|
||||
if (player->x > s->x) {
|
||||
s->xs = 1;
|
||||
} else {
|
||||
s->xs = -1;
|
||||
}
|
||||
}
|
||||
|
||||
s->x += s->xs;
|
||||
|
@ -2954,9 +2974,11 @@ if (s->id == P_PUFF) printf("PUFF WITH DOOMCOUNT!\n");
|
|||
s->xs = -s->xs;
|
||||
s->x = s->img->w/2;
|
||||
}
|
||||
if (s->y >= (480 - s->img->h)) {
|
||||
//if (s->y >= (480 - s->img->h)) {
|
||||
if (s->y >= 480-1) {
|
||||
s->ys = -s->ys;
|
||||
s->y = 480 - s->img->h;
|
||||
//s->y = 480 - s->img->h;
|
||||
s->y = 480-1;
|
||||
}
|
||||
if (s->y <= (s->img->h)) {
|
||||
s->ys = -s->ys;
|
||||
|
@ -2964,7 +2986,9 @@ if (s->id == P_PUFF) printf("PUFF WITH DOOMCOUNT!\n");
|
|||
}
|
||||
|
||||
|
||||
if (timer % CLOUDGROWSPEED == 0) {
|
||||
//if (timer % CLOUDGROWSPEED == 0) {
|
||||
if (1) {
|
||||
double growamt;
|
||||
//int w,h;
|
||||
SDL_Surface *ts, *cloudim;
|
||||
|
||||
|
@ -2973,16 +2997,18 @@ if (s->id == P_PUFF) printf("PUFF WITH DOOMCOUNT!\n");
|
|||
//w = s->img->w;
|
||||
//h = s->img->h;
|
||||
//ts = rotozoomSurfaceXY(s->img,0, 1.1 , 1.1 ,0);
|
||||
s->size += CLOUDGROWAMT;
|
||||
growamt = ((double)CLOUDGROWAMT / (double)CLOUDGROWSPEED);
|
||||
s->size += growamt;
|
||||
//printf("grow, now %0.2f\n",s->size);
|
||||
// TODO: free old first? depends if we ever use a preset one
|
||||
ts = rotozoomSurfaceXY(cloudim,0,s->size, s->size, 0);
|
||||
SDL_FreeSurface(s->img);
|
||||
s->img = ts;
|
||||
|
||||
s->y += 2;
|
||||
s->y += growamt;
|
||||
|
||||
}
|
||||
} // end if !s->invuln
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue