#include "app/setup.h"
#include "high_scores.h"
#include "gui/menu.h"
-#include "badguy.h"
#include "sector.h"
#include "player.h"
#include "level.h"
{
current_ = this;
- global_frame_counter = 0;
game_pause = false;
fps_fps = 0;
context.draw_text(white_text, str, Vector(screen->w/2, 210),
CENTER_ALLIGN, LAYER_FOREGROUND1);
- if(level->get_author().size())
+ if((level->get_author().size()) && (level->get_author() != "SuperTux Team"))
+ //TODO make author check case/blank-insensitive
context.draw_text(white_small_text,
- std::string(_("by ")) + level->get_author(),
+ std::string(_("contributed by ")) + level->get_author(),
Vector(screen->w/2, 350), CENTER_ALLIGN, LAYER_FOREGROUND1);
tux.kill(tux.KILL);
last_keys.clear();
}
+ if(compare_last(last_keys, "grid"))
+ { // toggle debug grid
+ debug_grid = !debug_grid;
+ last_keys.clear();
+ }
if(compare_last(last_keys, "hover"))
{ // toggle hover ability on/off
tux.enable_hover = !tux.enable_hover;
Uint32 lastticks = SDL_GetTicks();
fps_ticks = SDL_GetTicks();
- frame_timer.start(.025, true);
while (exit_status == ES_NONE) {
Uint32 ticks = SDL_GetTicks();
float elapsed_time = float(ticks - lastticks) / 1000.;
global_time += elapsed_time;
lastticks = ticks;
+
// 40fps is minimum
- if(elapsed_time > .05)
- elapsed_time = .05;
+ if(elapsed_time > .025)
+ elapsed_time = .025;
- if(frame_timer.check()) {
- ++global_frame_counter;
- }
-
/* Handle events: */
currentsector->player->input.old_fire = currentsector->player->input.fire;
currentsector->player->input.old_up = currentsector->player->input.old_up;
context.draw_text(white_text, _("TIME's UP"), Vector(screen->w/2, 0),
CENTER_ALLIGN, LAYER_FOREGROUND1);
} else if (time_left.get_timeleft() > TIME_WARNING
- || (global_frame_counter % 10) < 5) {
+ || int(global_time * 2.5) % 2) {
sprintf(str, " %d", int(time_left.get_timeleft()));
context.draw_text(white_text, _("TIME"),
Vector(screen->w/2, 0), CENTER_ALLIGN, LAYER_FOREGROUND1);