#include "tile.h"
#include "particlesystem.h"
#include "resources.h"
+#include "music_manager.h"
GameSession* GameSession::current_ = 0;
void
GameSession::levelintro(void)
{
+ music_manager->halt_music();
+
char str[60];
/* Level Intro: */
clearscreen(0, 0, 0);
void
GameSession::on_escape_press()
{
+ if(game_pause)
+ return;
+
if(st_gl_mode == ST_GL_TEST)
{
exit_status = LEVEL_ABORT;
}
else
{
+ if(!Menu::current() && !game_pause)
+ st_pause_ticks_stop();
+
SDL_Event event;
while (SDL_PollEvent(&event))
{
{
Player& tux = *world->get_tux();
- st_pause_ticks_stop();
-
switch(event.type)
{
case SDL_QUIT: /* Quit event - quit: */
{
end_sequenze = true;
last_x_pos = -1;
- halt_music();
+ music_manager->halt_music();
}
else
{
{
switch (game_menu->check())
{
- case 2:
+ case MNID_CONTINUE:
st_pause_ticks_stop();
break;
- case 5:
+ case MNID_ABORTLEVEL:
st_pause_ticks_stop();
exit_status = LEVEL_ABORT;
break;
GameSession::run()
{
Menu::set_current(0);
- Player* tux = world->get_tux();
current_ = this;
int fps_cnt = 0;
}
/* Handle events: */
- tux->input.old_fire = tux->input.fire;
+ world->get_tux()->input.old_fire = world->get_tux()->input.fire;
process_events();
process_menu();
}
/* Handle time: */
- if (!time_left.check() && tux->dying == DYING_NOT)
- tux->kill(KILL);
+ if (!time_left.check() && world->get_tux()->dying == DYING_NOT)
+ world->get_tux()->kill(Player::KILL);
/* Handle music: */
- if(tux->invincible_timer.check())
+ if(world->get_tux()->invincible_timer.check())
{
if(world->get_music_type() != HERRING_MUSIC)
world->play_music(HERRING_MUSIC);
}
sprintf(str, "%d", player_status.distros);
- white_text->draw("DISTROS", screen->h, 0, 1);
+ white_text->draw("COINS", screen->h, 0, 1);
gold_text->draw(str, 608, 0, 1);
white_text->draw("LIVES", screen->h, 20, 1);
sprintf(str, "SCORE: %d", player_status.score);
gold_text->drawf(str, 0, 224, A_HMIDDLE, A_TOP, 1);
- sprintf(str, "DISTROS: %d", player_status.distros);
+ sprintf(str, "COINS: %d", player_status.distros);
gold_text->drawf(str, 0, 256, A_HMIDDLE, A_TOP, 1);
flipscreen();