void
GameSession::on_escape_press()
{
+ if(world->get_tux()->dying)
+ return; // don't let the player open the menu, when he is dying
if(game_pause)
return;
if (player_status.lives < 0)
{ // No more lives!?
- if(st_gl_mode != ST_GL_TEST)
- drawendscreen();
-
exit_status = ES_GAME_OVER;
}
else
}
void
-GameSession::drawendscreen()
-{
- char str[80];
-
- if (get_level()->img_bkgd)
- get_level()->draw_bg();
- else
- drawgradient(get_level()->bkgd_top, get_level()->bkgd_bottom);
-
- blue_text->drawf("GAMEOVER", 0, 200, A_HMIDDLE, A_TOP, 1);
-
- sprintf(str, "SCORE: %d", player_status.score);
- gold_text->drawf(str, 0, 224, A_HMIDDLE, A_TOP, 1);
-
- sprintf(str, "COINS: %d", player_status.distros);
- gold_text->drawf(str, 0, screen->w - gold_text->w*2, A_HMIDDLE, A_TOP, 1);
-
- flipscreen();
-
- SDL_Event event;
- wait_for_event(event,2000,5000,true);
-}
-
-void
GameSession::drawresultscreen(void)
{
char str[80];
// is to hard)
break;
case GameSession::ES_GAME_OVER:
+ /* draw an end screen */
+ /* in the future, this should make a dialog a la SuperMario, asking
+ if the player wants to restart the world map with no score and from
+ level 1 */
+ char str[80];
+
+ drawgradient(Color (0, 255, 0), Color (255, 0, 255));
+
+ blue_text->drawf("GAMEOVER", 0, 200, A_HMIDDLE, A_TOP, 1);
+
+ sprintf(str, "SCORE: %d", player_status.score);
+ gold_text->drawf(str, 0, 224, A_HMIDDLE, A_TOP, 1);
+
+ sprintf(str, "COINS: %d", player_status.distros);
+ gold_text->drawf(str, 0, screen->w - gold_text->w*2, A_HMIDDLE, A_TOP, 1);
+
+ flipscreen();
+
+ SDL_Event event;
+ wait_for_event(event,2000,5000,true);
+
quit = true;
player_status.reset();
break;