texture_type img_money_right[2];
texture_type img_mrbomb_left[4];
texture_type img_mrbomb_right[4];
+texture_type img_mrbomb_ticking_left;
+texture_type img_mrbomb_ticking_right;
+texture_type img_mrbomb_explosion;
texture_type img_stalactite;
texture_type img_stalactite_broken;
texture_type img_flame[2];
void
BadGuy::init(float x, float y, BadGuyKind kind_)
{
+ base.x = x;
+ base.y = y;
base.width = 32;
base.height = 32;
mode = NORMAL;
dying = DYING_NOT;
kind = kind_;
- base.x = x;
- base.y = y;
base.xm = -1.3;
- base.ym = 4.8;
+ base.ym = 0;
old_base = base;
dir = LEFT;
seen = false;
dying = DYING_SQUISHED;
} else if(kind == BAD_FLAME) {
base.ym = 0; // we misuse base.ym as angle for the flame
+ } else if(kind == BAD_MONEY) {
+ base.ym = 4.8;
}
}
/* --- BLUE SCREEN OF DEATH MONSTER: --- */
/* Move left/right: */
- if (dying == DYING_NOT ||
- dying == DYING_FALLING)
+ if (dying == DYING_NOT || dying == DYING_FALLING)
{
base.x += base.xm * frame_ratio;
}
/* Move vertically: */
- base.y = base.y + base.ym * frame_ratio;
+ base.y += base.ym * frame_ratio;
if (dying != DYING_FALLING)
collision_swept_object_map(&old_base,&base);
fall(true);
// Handle dying timer:
- if (dying == DYING_SQUISHED)
+ if (dying == DYING_SQUISHED && !timer_check(&timer))
{
/* Remove it if time's up: */
- if(!timer_check(&timer)) {
- remove_me();
- return;
- }
+ remove_me();
+ return;
}
}
fall();
/* Handle mode timer: */
- if (mode == FLAT && mode != HELD)
+ if (mode == FLAT)
{
if(!timer_check(&timer))
{
mode = NORMAL;
- base.xm = 4;
+ base.xm = (dir == LEFT) ? -1.3 : 1.3;
}
}
- else if (mode == KICK)
- {
- timer_check(&timer);
- }
}
void BadGuy::check_horizontal_bump(bool checkcliff)
// don't check for cliffs when we're falling
if(!checkcliff)
return;
+ if(!issolid(base.x + base.width/2, base.y + base.height + 16))
+ return;
if(dir == LEFT && !issolid(base.x, (int) base.y + base.height + 16))
{
/* Fall if we get off the ground: */
if (dying != DYING_FALLING)
{
- if (!issolid(base.x+16, base.y + 32))
+ if (!issolid(base.x+base.width/2, base.y + base.height))
{
if(!physic_is_set(&physic))
{
physic_set_start_vy(&physic, dojump ? 2. : 0.);
}
- if(mode != HELD)
- {
- base.ym = physic_get_velocity(&physic);
- }
+ base.ym = physic_get_velocity(&physic);
}
else
{
/* Land: */
-
if (base.ym > 0)
{
- base.y = (int)(base.y / 32) * 32;
+ base.y = int((base.y + base.height)/32) * 32 - base.height;
base.ym = 0;
}
physic_init(&physic);
physic_set_state(&physic,PH_VT);
physic_set_start_vy(&physic,6.);
base.ym = physic_get_velocity(&physic);
+ mode = MONEY_JUMP;
}
- /* // matze: is this code needed?
- else if(issolid(base.x, base.y))
- { // This works, but isn't the best solution imagineable
- physic_set_state(&physic,PH_VT);
- physic_set_start_vy(&physic,0.);
- base.ym = physic_get_velocity(&physic);
- ++base.y;
- }*/
else
{
base.ym = physic_get_velocity(&physic);
+ mode = NORMAL;
}
}
else
mode = BOMB_EXPLODE;
dying = DYING_NOT; // now the bomb hurts
timer_start(&timer, 1000);
+ // explosion image has different size
+ base.x -= (img_mrbomb_explosion.w - base.width) / 2;
+ base.y -= img_mrbomb_explosion.h - base.height;
+ base.width = img_mrbomb_explosion.w;
+ base.height = img_mrbomb_explosion.h;
+ old_base = base;
} else if(mode == BOMB_EXPLODE) {
remove_me();
return;
void BadGuy::action_stalactite()
{
if(mode == NORMAL) {
- if(tux.base.x + 32 > base.x - 40 && tux.base.x < base.x + 32 + 40) {
+ static const int range = 40;
+ // start shaking when tux is below the stalactite and at least 40 pixels
+ // near
+ if(tux.base.x + 32 > base.x - range && tux.base.x < base.x + 32 + range
+ && tux.base.y + tux.base.height > base.y) {
timer_start(&timer, 800);
mode = STALACTITE_SHAKING;
}
mode = STALACTITE_FALL;
}
} else if(mode == STALACTITE_FALL) {
- base.y += base.ym * frame_ratio;
+ base.y += base.ym * frame_ratio;
+ fall();
/* Destroy if collides land */
if(issolid(base.x+16, base.y+32))
{
dying = DYING_SQUISHED;
mode = FLAT;
}
+ } else if(mode == FLAT) {
+ if(!timer_check(&timer)) {
+ remove_me();
+ }
}
}
void
BadGuy::action()
-{
- if (seen)
- {
- switch (kind)
- {
- case BAD_BSOD:
- action_bsod();
- break;
-
- case BAD_LAPTOP:
- action_laptop();
- break;
-
- case BAD_MONEY:
- action_money();
- break;
-
- case BAD_MRBOMB:
- action_mrbomb();
- break;
-
- case BAD_BOMB:
- action_bomb();
- break;
-
- case BAD_STALACTITE:
- action_stalactite();
- break;
-
- case BAD_FLAME:
- action_flame();
- break;
- }
- }
-
+{
// Remove if it's far off the screen:
if (base.x < scroll_x - OFFSCREEN_DISTANCE)
{
- remove_me();
+ remove_me();
return;
}
- else /* !seen */
+
+ // Once it's on screen, it's activated!
+ if (base.x <= scroll_x + screen->w + OFFSCREEN_DISTANCE)
+ seen = true;
+
+ if(!seen)
+ return;
+
+ switch (kind)
{
- // Once it's on screen, it's activated!
- if (base.x <= scroll_x + screen->w + OFFSCREEN_DISTANCE)
- seen = true;
+ case BAD_BSOD:
+ action_bsod();
+ break;
+
+ case BAD_LAPTOP:
+ action_laptop();
+ break;
+
+ case BAD_MONEY:
+ action_money();
+ break;
+
+ case BAD_MRBOMB:
+ action_mrbomb();
+ break;
+
+ case BAD_BOMB:
+ action_bomb();
+ break;
+
+ case BAD_STALACTITE:
+ action_stalactite();
+ break;
+
+ case BAD_FLAME:
+ action_flame();
+ break;
}
}
BadGuy::draw_bsod()
{
texture_type* texture = 0;
- float y = base.y;
+
if(dying == DYING_NOT) {
size_t frame = (global_frame_counter / 5) % 4;
texture = (dir == LEFT) ? &img_bsod_left[frame] : &img_bsod_right[frame];
} else if(dying == DYING_SQUISHED) {
texture = (dir == LEFT)
? &img_bsod_squished_left : &img_bsod_squished_right;
- y += 24;
}
- texture_draw(texture, base.x - scroll_x, y);
+ texture_draw(texture, base.x - scroll_x, base.y);
}
void
BadGuy::draw_money()
{
texture_type* texture;
- size_t frame = (base.ym != 300) ? 0 : 1;
+ size_t frame = (mode == NORMAL) ? 0 : 1;
if(tux.base.x + tux.base.width < base.x) {
texture = &img_money_left[frame];
BadGuy::draw_bomb()
{
texture_type* texture;
-
+
// TODO add real bomb graphics
if(mode == BOMB_TICKING) {
- texture = &img_bsod_squished_right;
+ texture = (dir == LEFT)
+ ? &img_mrbomb_ticking_left : &img_mrbomb_ticking_right;
} else {
- texture = &img_bsod_squished_left;
+ texture = &img_mrbomb_explosion;
}
texture_draw(texture, base.x - scroll_x, base.y);
BadGuy::draw()
{
// Don't try to draw stuff that is outside of the screen
- if (base.x > scroll_x - 32 &&
- base.x < scroll_x + screen->w)
+ if (base.x <= scroll_x - base.width || base.x >= scroll_x + screen->w)
+ return;
+
+ switch (kind)
{
- switch (kind)
- {
- case BAD_BSOD:
- draw_bsod();
- break;
-
- case BAD_LAPTOP:
- draw_laptop();
- break;
-
- case BAD_MONEY:
- draw_money();
- break;
+ case BAD_BSOD:
+ draw_bsod();
+ break;
+
+ case BAD_LAPTOP:
+ draw_laptop();
+ break;
- case BAD_MRBOMB:
- draw_mrbomb();
- break;
+ case BAD_MONEY:
+ draw_money();
+ break;
- case BAD_BOMB:
- draw_bomb();
- break;
+ case BAD_MRBOMB:
+ draw_mrbomb();
+ break;
- case BAD_STALACTITE:
- draw_stalactite();
- break;
+ case BAD_BOMB:
+ draw_bomb();
+ break;
- case BAD_FLAME:
- draw_flame();
- break;
+ case BAD_STALACTITE:
+ draw_stalactite();
+ break;
+
+ case BAD_FLAME:
+ draw_flame();
+ break;
- }
}
}
BadGuy::make_player_jump(Player* player)
{
physic_set_state(&player->vphysic,PH_VT);
- physic_set_start_vy(&player->vphysic,2.);
- player->base.y = base.y - player->base.height - 1;
+ physic_set_start_vy(&player->vphysic, 2.);
+ player->base.y = base.y - player->base.height - 2;
}
void
return;
} else if(kind == BAD_BSOD) {
- dying = DYING_SQUISHED;
- timer_start(&timer,4000);
-
make_player_jump(player);
add_score(base.x - scroll_x, base.y, 50 * score_multiplier);
play_sound(sounds[SND_SQUISH], SOUND_CENTER_SPEAKER);
score_multiplier++;
+
+ dying = DYING_SQUISHED;
+ timer_start(&timer, 2000);
+ base.y += base.height - img_bsod_squished_left.h;
+ base.height = img_bsod_squished_left.h;
+ base.xm = base.ym = 0;
+ old_base = base;
return;
} else if (kind == BAD_LAPTOP) {
/* Flatten! */
play_sound(sounds[SND_STOMP], SOUND_CENTER_SPEAKER);
mode = FLAT;
- base.xm = 4;
+ base.xm = 0;
timer_start(&timer, 4000);
} else if (mode == FLAT) {
/* Kick! */
play_sound(sounds[SND_KICK], SOUND_CENTER_SPEAKER);
- if (player->base.x < base.x + (base.width/2))
+ if (player->base.x < base.x + (base.width/2)) {
+ base.xm = 5;
dir = RIGHT;
- else
+ } else {
+ base.xm = -5;
dir = LEFT;
+ }
- base.xm = 5;
mode = KICK;
-
- timer_start(&timer,5000);
}
make_player_jump(player);
- add_score(base.x - scroll_x,
- base.y,
- 25 * score_multiplier);
+ add_score(base.x - scroll_x, base.y, 25 * score_multiplier);
score_multiplier++;
return;
}
case CO_BADGUY:
pbad_c = (BadGuy*) p_c_object;
- if (mode == NORMAL)
- {
- /* do nothing */
- }
- else if(mode == KICK)
+ if(kind == BAD_LAPTOP && mode == KICK)
{
/* We're in kick mode, kill the other guy
and yourself(wuahaha) : */
add_score(base.x - scroll_x,
base.y, 100);
- pbad_c->dying = DYING_FALLING;
dying = DYING_FALLING;
base.ym = -8;
texture_load(&img_mrbomb_right[i],
datadir + "/images/shared/mrbomb-right-" + num + ".png", USE_ALPHA);
}
+ texture_load(&img_mrbomb_ticking_left,
+ datadir + "/images/shared/mrbombx-left-0.png", USE_ALPHA);
+ texture_load(&img_mrbomb_ticking_right,
+ datadir + "/images/shared/mrbombx-right-0.png", USE_ALPHA);
+ texture_load(&img_mrbomb_explosion,
+ datadir + "/images/shared/mrbomb-explosion.png", USE_ALPHA);
/* stalactite */
texture_load(&img_stalactite,
texture_free(&img_mrbomb_right[i]);
}
+ texture_free(&img_mrbomb_ticking_left);
+ texture_free(&img_mrbomb_ticking_right);
+ texture_free(&img_mrbomb_explosion);
+
texture_free(&img_stalactite);
texture_free(&img_stalactite_broken);
intro.c
Super Tux - Intro Screen
-
+
by Bill Kendrick
bill@newbreedsoftware.com
http://www.newbreedsoftware.com/supertux/
#include "timer.h"
char * intro_text[] = {
- "Tux and Gown were having a nice picnic..",
- "when suddenly...",
- "Gown is beamed away!!!",
- "This looks like a job for ---"
-};
+ "Tux and Gown were having a nice picnic..",
+ "when suddenly...",
+ "Gown is beamed away!!!",
+ "This looks like a job for ---"
+ };
/* --- INTRO --- */
{
SDL_Event event;
texture_type bkgd, copter_squish, copter_stretch, beam,
- gown_sit, gown_lookup, gown_upset,
- tux_sit, tux_upset, tux_mad;
+ gown_sit, gown_lookup, gown_upset,
+ tux_sit, tux_upset, tux_mad;
texture_type copter[2];
SDL_Rect src, dest;
int done, i, quit, j, scene;
int * height, * height_speed;
timer_type timer;
-
+
/* Load sprite images: */
- texture_load(&bkgd, datadir + "/images/intro/intro.png", IGNORE_ALPHA);
+ texture_load(&bkgd, datadir + "/images/intro/intro.png", IGNORE_ALPHA);
texture_load(&gown_sit, datadir + "/images/intro/gown-sit.png", USE_ALPHA);
texture_load(&gown_lookup, datadir + "/images/intro/gown-lookup.png", USE_ALPHA);
texture_load(&gown_upset, datadir + "/images/intro/gown-upset.png", USE_ALPHA);
texture_load(&tux_upset, datadir + "/images/intro/tux-upset.png", USE_ALPHA);
texture_load(&tux_mad, datadir + "/images/intro/tux-mad.png", USE_ALPHA);
texture_load(&copter[0], datadir + "/images/intro/copter1.png", USE_ALPHA);
- texture_load(&copter[1], datadir + "/images/intro/copter2.png", USE_ALPHA);
- texture_load(&copter_squish, datadir + "/images/intro/copter-squish.png", USE_ALPHA);
- texture_load(&copter_stretch, datadir + "/images/intro/copter-stretch.png", USE_ALPHA);
- texture_load(&beam, datadir + "/images/intro/beam.png", USE_ALPHA);
-
+ texture_load(&copter[1], datadir + "/images/intro/copter2.png", USE_ALPHA);
+ texture_load(&copter_squish, datadir + "/images/intro/copter-squish.png", USE_ALPHA);
+ texture_load(&copter_stretch, datadir + "/images/intro/copter-stretch.png", USE_ALPHA);
+ texture_load(&beam, datadir + "/images/intro/beam.png", USE_ALPHA);
+
/* Allocate buffer for height array: */
-
+
height = (int*) malloc(sizeof(int) * (gown_upset.w));
height_speed = (int*) malloc(sizeof(int) * (gown_upset.w));
-
-
+
+
/* Initialize height arrays: */
-
+
for (j = 0; j < (gown_upset.w); j++)
{
height[j] = 400;
height_speed[j] = (rand() % 10) + 1;
}
-
- /* Display background: */
-
+
+ /* Display background: */
+
texture_draw_bg(&bkgd, UPDATE);
-
+
/* Animation: */
-
+
done = 0;
quit = 0;
scene = 0;
i = 0;
-
+
timer_init(&timer, false);
timer_start(&timer,10000);
-
+
while (timer_check(&timer) && !done && !quit)
{
-
- /* Handle events: */
-
- while (SDL_PollEvent(&event))
+
+
+ done = wait_for_event(event,0);
+ if(done == 2)
{
- if (event.type == SDL_QUIT)
- {
- /* Quit event - quit: */
-
- quit = 1;
- }
- else if (event.type == SDL_KEYDOWN)
- {
- /* Keypress - skip intro: */
-
- done = 1;
- }
- else if (event.type == SDL_JOYBUTTONDOWN)
- {
- /* Fire button - skip intro: */
-
- done = 1;
- }
- }
-
-
- /* Display background: */
-
+ quit = 1;
+ done = 0;
+ }
+
+
+ /* Display background: */
+
/* Draw things: */
-
+
if (timer_get_gone(&timer) < 2000 && scene == 0)
- {
- ++scene;
- /* Gown and tux sitting: */
-
- texture_draw(&tux_sit, 270, 400, UPDATE);
- texture_draw(&gown_sit, 320, 400, UPDATE);
-
- text_drawf(&white_text, intro_text[0], 0, -8, A_HMIDDLE, A_BOTTOM, 0);
- }
-
-
+ {
+ ++scene;
+ /* Gown and tux sitting: */
+
+ texture_draw(&tux_sit, 270, 400, UPDATE);
+ texture_draw(&gown_sit, 320, 400, UPDATE);
+
+ text_drawf(&white_text, intro_text[0], 0, -8, A_HMIDDLE, A_BOTTOM, 0);
+ }
+
+
if (timer_get_gone(&timer) >= 2000 && scene == 1)
- {
- ++scene;
- /* Helicopter begins to fly in: */
-
- erasecenteredtext(&white_text, intro_text[0], 454, &bkgd, NO_UPDATE, 1);
- text_drawf(&white_text, intro_text[1], 0,-8, A_HMIDDLE, A_BOTTOM, 0);
- }
-
-
+ {
+ ++scene;
+ /* Helicopter begins to fly in: */
+
+ erasecenteredtext(&white_text, intro_text[0], 454, &bkgd, NO_UPDATE, 1);
+ text_drawf(&white_text, intro_text[1], 0,-8, A_HMIDDLE, A_BOTTOM, 0);
+ }
+
+
if (timer_get_gone(&timer) >= 2000 && timer_get_gone(&timer) < 4000)
- {
- /* Helicopter flying in: */
- texture_draw_part(&bkgd,0,32, 0, 32, screen->w, (copter[0].h));
-
- texture_draw(&copter[i % 2],
- (float)(timer_get_gone(&timer) - 2000) / 5 - (copter[0].w), 32,
- NO_UPDATE);
-
- update_rect(screen, 0, 32, screen->w, (copter[0].h));
- }
-
-
+ {
+ /* Helicopter flying in: */
+ texture_draw_part(&bkgd,0,32, 0, 32, screen->w, (copter[0].h));
+
+ texture_draw(&copter[i % 2],
+ (float)(timer_get_gone(&timer) - 2000) / 5 - (copter[0].w), 32,
+ NO_UPDATE);
+
+ update_rect(screen, 0, 32, screen->w, (copter[0].h));
+ }
+
+
if (timer_get_gone(&timer) >= 2500 && scene == 2)
- {
- ++scene;
- /* Gown notices something... */
-
- texture_draw(&gown_lookup, 320, 400, UPDATE);
- }
-
-
+ {
+ ++scene;
+ /* Gown notices something... */
+
+ texture_draw(&gown_lookup, 320, 400, UPDATE);
+ }
+
+
if (timer_get_gone(&timer) >= 3500 && scene == 3)
- {
- ++scene;
- /* Gown realizes it's bad! */
-
- texture_draw(&gown_upset, 320, 400, UPDATE);
- }
-
-
+ {
+ ++scene;
+ /* Gown realizes it's bad! */
+
+ texture_draw(&gown_upset, 320, 400, UPDATE);
+ }
+
+
if (timer_get_gone(&timer) >= 4000 && timer_get_gone(&timer) < 8000)
- {
- /* Helicopter sits: */
- texture_draw_part(&bkgd,0,32, 0, 32, screen->w, (copter[0].h));
-
- texture_draw(&copter[i % 2], 400 - (copter[0].w), 32);
- update_rect(screen, 0, 32, screen->w, (copter[0].h));
- }
-
-
+ {
+ /* Helicopter sits: */
+ texture_draw_part(&bkgd,0,32, 0, 32, screen->w, (copter[0].h));
+
+ texture_draw(&copter[i % 2], 400 - (copter[0].w), 32);
+ update_rect(screen, 0, 32, screen->w, (copter[0].h));
+ }
+
+
if (timer_get_gone(&timer) >= 5000 && scene == 4)
- {
- ++scene;
- /* Tux realizes something's happening: */
-
- texture_draw(&tux_upset, 270, 400, UPDATE);
-
-
- erasecenteredtext(&white_text, intro_text[1], 454, &bkgd, UPDATE, 1);
- text_drawf(&white_text, intro_text[2], 0,-8, A_HMIDDLE, A_BOTTOM, 0);
- }
-
-
+ {
+ ++scene;
+ /* Tux realizes something's happening: */
+
+ texture_draw(&tux_upset, 270, 400, UPDATE);
+
+
+ erasecenteredtext(&white_text, intro_text[1], 454, &bkgd, UPDATE, 1);
+ text_drawf(&white_text, intro_text[2], 0,-8, A_HMIDDLE, A_BOTTOM, 0);
+ }
+
+
if (timer_get_gone(&timer) >= 5000 && timer_get_gone(&timer) <= 8000)
- {
- /* Beam gown up! */
-
- texture_draw_part(&bkgd,
- 310, 32 + (copter[0].h), 310,
- 32 + (copter[0].h),
- (gown_upset.w) + 20,
- 376 + (gown_upset.h) - (copter[0].h));
-
-
- for (j = 0; j < (gown_upset.sdl_surface -> w); j++)
- {
- texture_draw(&beam, 320 + j - ((beam.w) / 2), height[j],
- NO_UPDATE);
-
- src.x = j;
- src.y = 0;
- src.w = 1;
- src.h = (gown_upset.h);
-
- dest.x = 320 + j;
- dest.y = height[j];
- dest.w = src.w;
- dest.h = src.h;
-
- texture_draw_part(&gown_upset,src.x,src.y,dest.x,dest.y,dest.w,dest.h);
-
- height[j] = 400 + rand() % 10 - (int)(300. * ((float)(timer_get_gone(&timer) - 5000)/(float)3000.));
- if(height[j] < 105)
- height[j] = 105;
- }
-
- update_rect(screen,
- 310,
- 32 + (copter[0].h),
- (gown_upset.w) + 20,
- 400 + (gown_upset.h) - (copter[0].h));
- }
-
-
+ {
+ /* Beam gown up! */
+
+ texture_draw_part(&bkgd,
+ 310, 32 + (copter[0].h), 310,
+ 32 + (copter[0].h),
+ (gown_upset.w) + 20,
+ 376 + (gown_upset.h) - (copter[0].h));
+
+
+ for (j = 0; j < (gown_upset.sdl_surface -> w); j++)
+ {
+ texture_draw(&beam, 320 + j - ((beam.w) / 2), height[j],
+ NO_UPDATE);
+
+ src.x = j;
+ src.y = 0;
+ src.w = 1;
+ src.h = (gown_upset.h);
+
+ dest.x = 320 + j;
+ dest.y = height[j];
+ dest.w = src.w;
+ dest.h = src.h;
+
+ texture_draw_part(&gown_upset,src.x,src.y,dest.x,dest.y,dest.w,dest.h);
+
+ height[j] = 400 + rand() % 10 - (int)(300. * ((float)(timer_get_gone(&timer) - 5000)/(float)3000.));
+ if(height[j] < 105)
+ height[j] = 105;
+ }
+
+ update_rect(screen,
+ 310,
+ 32 + (copter[0].h),
+ (gown_upset.w) + 20,
+ 400 + (gown_upset.h) - (copter[0].h));
+ }
+
+
if (timer_get_gone(&timer) >= 8000 && scene == 5)
- {
- texture_draw_part(&bkgd,
- 310, 32 + (copter[0].h), 310,
- 32 + (copter[0].h),
- (gown_upset.w) + 20,
- 368 + (gown_upset.h) - (copter[0].h));
-
- ++scene;
- /* Tux gets mad! */
-
- texture_draw(&tux_mad, 270, 400, UPDATE);
-
- erasecenteredtext(&white_text, intro_text[2], 454, &bkgd, UPDATE, 1);
- text_drawf(&white_text, intro_text[3], 0,-8, A_HMIDDLE, A_BOTTOM, 0);
- }
-
-
+ {
+ texture_draw_part(&bkgd,
+ 310, 32 + (copter[0].h), 310,
+ 32 + (copter[0].h),
+ (gown_upset.w) + 20,
+ 368 + (gown_upset.h) - (copter[0].h));
+
+ ++scene;
+ /* Tux gets mad! */
+
+ texture_draw(&tux_mad, 270, 400, UPDATE);
+
+ erasecenteredtext(&white_text, intro_text[2], 454, &bkgd, UPDATE, 1);
+ text_drawf(&white_text, intro_text[3], 0,-8, A_HMIDDLE, A_BOTTOM, 0);
+ }
+
+
if (timer_get_gone(&timer) >= 8000 && timer_get_gone(&timer) <= 8250)
- {
- /* Helicopter starting to speed off: */
-
- texture_draw_part(&bkgd, 0, 32, 0, 32, screen->w, (copter_squish.h));
-
- texture_draw(&copter_squish,
- 400 - (copter[0].w), 32,
- NO_UPDATE);
+ {
+ /* Helicopter starting to speed off: */
+
+ texture_draw_part(&bkgd, 0, 32, 0, 32, screen->w, (copter_squish.h));
- update_rect(screen, 0, 32, screen->w, (copter_squish.h));
- }
+ texture_draw(&copter_squish,
+ 400 - (copter[0].w), 32,
+ NO_UPDATE);
+
+ update_rect(screen, 0, 32, screen->w, (copter_squish.h));
+ }
if (timer_get_gone(&timer) >= 8250)
- {
- /* Helicopter speeding off: */
-
- texture_draw_part(&bkgd, 0, 32, 0, 32, screen->w, (copter_stretch.h));
-
- texture_draw(&copter_stretch,
- (timer_get_gone(&timer) - 8250) /*(i - (8250 / FPS)) * 30*/ + 400 - (copter[0].w),
- 32,
- NO_UPDATE);
-
- update_rect(screen, 0, 32, screen->w, (copter_stretch.h));
- }
-
- flipscreen();
+ {
+ /* Helicopter speeding off: */
+
+ texture_draw_part(&bkgd, 0, 32, 0, 32, screen->w, (copter_stretch.h));
+
+ texture_draw(&copter_stretch,
+ (timer_get_gone(&timer) - 8250) /*(i - (8250 / FPS)) * 30*/ + 400 - (copter[0].w),
+ 32,
+ NO_UPDATE);
+
+ update_rect(screen, 0, 32, screen->w, (copter_stretch.h));
+ }
+
+ flipscreen();
++i;
/* Pause: */
SDL_Delay(20);
}
-
+
/* Free surfaces: */
-
+
texture_free(&bkgd);
texture_free(&gown_sit);
texture_free(&gown_lookup);
texture_free(&copter_squish);
texture_free(&copter_stretch);
texture_free(&beam);
-
-
+
+
/* Free array buffers: */
-
+
free(height);
free(height_speed);
-
-
+
+
/* Return to main! */
-
+
return(quit);
}