return false;
}
-GameSession::GameSession(const std::string& levelname_, int mode, bool flip_level_)
+GameSession::GameSession(const std::string& levelname_, int mode, bool flip_level_, Statistics* statistics)
: level(0), currentsector(0), st_gl_mode(mode),
- end_sequence(NO_ENDSEQUENCE), levelname(levelname_), flip_level(flip_level_)
+ end_sequence(NO_ENDSEQUENCE), levelname(levelname_), flip_level(flip_level_),
+ best_level_statistics(statistics)
{
current_ = this;
if(level->get_author().size())
context.draw_text_center(white_small_text,
std::string(_("by ")) + level->get_author(),
- Vector(0, 400), LAYER_FOREGROUND1);
+ Vector(0, 360), LAYER_FOREGROUND1);
if(flip_level)
_("Level Vertically Flipped!"),
Vector(0, 310), LAYER_FOREGROUND1);
+ if(best_level_statistics != NULL)
+ best_level_statistics->draw_message_info(context, _("Best Level Statistics"));
+
context.do_drawing();
SDL_Event event;
tux.invincible_timer.start(time_left.get_left());
last_keys.clear();
}
-
+ if(compare_last(last_keys, "shrink"))
+ { // remove powerups
+ tux.kill(tux.SHRINK);
+ last_keys.clear();
+ }
+ if(compare_last(last_keys, "kill"))
+ { // kill Tux
+ tux.kill(tux.KILL);
+ last_keys.clear();
+ }
break;
case SDL_JOYAXISMOTION:
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());
+ global_stats.set_points(TIME_NEEDED_STAT, time_left.get_gone() / 1000);
}
else if (!end_sequence && tux->is_dead())
{