From 68be907533d00e504ae346b1555eadb290dafcb5 Mon Sep 17 00:00:00 2001 From: Matthias Braun Date: Sun, 2 May 2004 15:51:12 +0000 Subject: [PATCH] fixed musicproblems in endgame and fixed multicoinblock problems (not optimal yet, but I don't want to do a complicated real fix before the release) SVN-Revision: 919 --- TODO | 8 ++++---- src/gameloop.cpp | 13 ++++--------- src/world.cpp | 21 ++++++++++----------- 3 files changed, 18 insertions(+), 24 deletions(-) diff --git a/TODO b/TODO index cc9cdd46c..be7041113 100644 --- a/TODO +++ b/TODO @@ -12,10 +12,6 @@ Todo - tux sometimes makes short jumps in the endsequence, mostly when going through the goal with a small jump, might be old_up related - fadein/out for intro/extro would be nice -- when jupming against the 2nd multiple coin block in a level only 1 coin will - come out. -- when jumping into the exit with a star, the endgame music will change back to - levelmusic after a short time - the can_jump flag should be based on a time instead of the 2 tiles check. Since the 2 tiles flag won't help when you're jumping over a hole. Better use a timer that is started when up is pressed, when you then land and the timer @@ -30,6 +26,10 @@ Todo Fixed ----- +- when jumping into the exit with a star, the endgame music will change back to + levelmusic after a short time +- when jupming against the 2nd multiple coin block in a level only 1 coin will + come out. - when you interrupted the intro (by going to credits for example) and go back to it, tux doesn't jump anymore - supertux crashs from time to time - fixed diff --git a/src/gameloop.cpp b/src/gameloop.cpp index b739d0565..c09dbba24 100644 --- a/src/gameloop.cpp +++ b/src/gameloop.cpp @@ -540,10 +540,6 @@ GameSession::run() update_time = last_update_time = st_get_ticks(); - /* Clear screen: */ -// clearscreen(0, 0, 0); -// updatescreen(); - // Eat unneeded events SDL_Event event; while (SDL_PollEvent(&event)) {} @@ -619,18 +615,17 @@ GameSession::run() world->get_tux()->kill(Player::KILL); /* Handle music: */ - if(world->get_tux()->invincible_timer.check()) + if(world->get_tux()->invincible_timer.check() && !end_sequence) { - if(world->get_music_type() != HERRING_MUSIC) - world->play_music(HERRING_MUSIC); + world->play_music(HERRING_MUSIC); } /* are we low on time ? */ - else if (time_left.get_left() < TIME_WARNING) + else if (time_left.get_left() < TIME_WARNING && !end_sequence) { world->play_music(HURRYUP_MUSIC); } /* or just normal music? */ - else if(world->get_music_type() != LEVEL_MUSIC) + else if(world->get_music_type() != LEVEL_MUSIC && !end_sequence) { world->play_music(LEVEL_MUSIC); } diff --git a/src/world.cpp b/src/world.cpp index f087b8019..cc01c3599 100644 --- a/src/world.cpp +++ b/src/world.cpp @@ -266,15 +266,6 @@ World::action(double frame_ratio) for (unsigned int i = 0; i < broken_bricks.size(); i++) broken_bricks[i]->action(frame_ratio); - /* Handle distro counting: */ - if (counting_distros) - { - distro_counter--; - - if (distro_counter <= 0) - counting_distros = -1; - } - // Handle all kinds of game objects for (unsigned int i = 0; i < bouncy_bricks.size(); i++) bouncy_bricks[i]->action(frame_ratio); @@ -513,14 +504,22 @@ World::trybreakbrick(float x, float y, bool small) add_bouncy_distro(((int)(x + 1) / 32) * 32, (int)(y / 32) * 32); + // TODO: don't handle this in a global way but per-tile... if (!counting_distros) { counting_distros = true; - distro_counter = 50; + distro_counter = 5; + } + else + { + distro_counter--; } if (distro_counter <= 0) - plevel->change(x, y, TM_IA, tile->next_tile); + { + counting_distros = false; + plevel->change(x, y, TM_IA, tile->next_tile); + } play_sound(sounds[SND_DISTRO], SOUND_CENTER_SPEAKER); player_status.score = player_status.score + SCORE_DISTRO; -- 2.11.0