last_x_pos = -1;
music_manager->play_music(level_end_song, 0);
endsequence_timer.start(7000);
+ tux->invincible_timer.start(7000); //FIXME: Implement a winning timer for the end sequence (with special winning animation etc.)
}
else if(end_sequence && !endsequence_timer.check())
{
last_x_pos = -1;
music_manager->play_music(level_end_song, 0);
endsequence_timer.start(7000); // 5 seconds until we finish the map
+ tux->invincible_timer.start(7000); //FIXME: Implement a winning timer for the end sequence (with special winning animation etc.)
}
else if (!end_sequence && tux->is_dead())
{
player_status.bonus = PlayerStatus::NO_BONUS;
- player_status.lives -= 1;
if (player_status.lives < 0)
{ // No more lives!?
gravity = 10.;
back_scrolling = false;
hor_autoscroll_speed = 0;
- bkgd_speed = 2;
+ bkgd_speed = 50;
bkgd_top.red = 0;
bkgd_top.green = 0;
bkgd_top.blue = 0;
hor_autoscroll_speed = 0;
reader.read_float("hor_autoscroll_speed", &hor_autoscroll_speed);
- bkgd_speed = 2;
+ bkgd_speed = 50;
reader.read_int("bkgd_speed", &bkgd_speed);
/* Draw the real background */
if(le_world->get_level()->bkgd_image[0] != '\0')
{
- s = (int)((float)pos_x * ((float)le_world->get_level()->bkgd_speed/60.)) % screen->w;
+ s = (int)((float)pos_x * ((float)le_world->get_level()->bkgd_speed/100.0f)) % screen->w;
le_world->get_level()->img_bkgd->draw_part(s,0,0,0,
le_world->get_level()->img_bkgd->w - s - 32, le_world->get_level()->img_bkgd->h);
le_world->get_level()->img_bkgd->draw_part(0,0,screen->w - s - 32 ,0,s,
physic.enable_gravity(true);
physic.set_acceleration(0, 0);
physic.set_velocity(0, 7);
+ if(dying != DYING_SQUISHED)
+ --player_status.lives;
dying = DYING_SQUISHED;
}
}
/* Draw the real background */
if(level->img_bkgd)
{
- int s = (int)((float)scroll_x * ((float)level->bkgd_speed/60.)) % screen->w;
+ int s = (int)((float)scroll_x * ((float)level->bkgd_speed/100.0f)) % screen->w;
level->img_bkgd->draw_part(s, 0,0,0,level->img_bkgd->w - s, level->img_bkgd->h);
level->img_bkgd->draw_part(0, 0,screen->w - s ,0,s,level->img_bkgd->h);
}