else if(!end_sequence && endtile && endtile->data == 0)
{
end_sequence = ENDSEQUENCE_RUNNING;
- random_timer.start(200); // start 1st firework
+ endsequence_timer.start(7000); // 5 seconds until we finish the map
last_x_pos = -1;
SoundManager::get()->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.)
// add left time to stats
global_stats.set_points(TIME_NEEDED_STAT, time_left.get_gone() / 1000);
+
+ random_timer.start(200); // start 1st firework
}
else if (!end_sequence && tux->is_dead())
{
}
// on end sequence make a few fireworks
- if(end_sequence == ENDSEQUENCE_RUNNING && !random_timer.check())
+ if(end_sequence == ENDSEQUENCE_RUNNING && !random_timer.check() &&
+ currentsector->end_sequence_animation() == FIREWORKS_ENDSEQ_ANIM)
{
Vector epicenter = currentsector->camera->get_translation();
epicenter.x += screen->w * ((float)rand() / RAND_MAX);
Sector::Sector()
: gravity(10), player(0), solids(0), background(0), camera(0),
- currentmusic(LEVEL_MUSIC)
+ currentmusic(LEVEL_MUSIC), end_sequence_animation_type(NONE_ENDSEQ_ANIM)
{
song_title = "Mortimers_chipdisko.mod";
player = new Player();
} else if(token == "music") {
song_title = lisp_string(data);
load_music();
+ } else if(token == "end-sequence-animation") {
+ std::string end_seq_anim = lisp_string(data);
+ if(end_seq_anim == "fireworks")
+ end_sequence_animation_type = FIREWORKS_ENDSEQ_ANIM;
} else if(token == "camera") {
if(camera) {
std::cerr << "Warning: More than 1 camera defined in sector.\n";
add_object(background);
}
+ std::string end_seq_anim;
+ reader.read_string("end-sequence-animation", end_seq_anim);
+ if(end_seq_anim == "fireworks")
+ end_sequence_animation_type = FIREWORKS_ENDSEQ_ANIM;
+// else
+// end_sequence_animation = NONE_ENDSEQ_ANIM;
+
std::string particlesystem;
reader.read_string("particle_system", particlesystem);
if(particlesystem == "clouds")
Vector pos;
};
+enum {
+ NONE_ENDSEQ_ANIM,
+ FIREWORKS_ENDSEQ_ANIM
+ };
+
/** This class holds a sector (a part of a level) and all the game objects
* (badguys, player, background, tilemap, ...)
*/
player to play the same level in a different way :) */
void do_vertical_flip();
+ /** Get end sequence animation */
+ int end_sequence_animation()
+ { return end_sequence_animation_type; }
+
/** @evil@ */
static Sector* current()
{ return _current; }
MusicRef level_song;
MusicRef level_song_fast;
+ int end_sequence_animation_type;
+
public:
std::string song_title;
float gravity;