else if (!Menu::current())
{
Menu::set_current(game_menu);
+ st_pause_ticks_start();
}
}
if (Menu::current())
{
Menu::current()->event(event);
- st_pause_ticks_start();
+ if(!Menu::current())
+ st_pause_ticks_stop();
}
switch(event.type)
if (Menu::current())
{
Menu::current()->event(event);
- st_pause_ticks_start();
+ if(!Menu::current())
+ st_pause_ticks_stop();
+
+ /* Tell Tux that the keys are all down, otherwise
+ it could have nasty bugs, like going allways to the right
+ or whatever that key does */
+ Player& tux = *world->get_tux();
+ tux.key_event((SDLKey)keymap.jump, UP);
+ tux.key_event((SDLKey)keymap.duck, UP);
+ tux.key_event((SDLKey)keymap.left, UP);
+ tux.key_event((SDLKey)keymap.right, UP);
+ tux.key_event((SDLKey)keymap.fire, UP);
}
else
{
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!?