6 by Bill Kendrick & Tobias Glaesser <tobi.web@gmx.de>
7 bill@newbreedsoftware.com
8 http://www.newbreedsoftware.com/supertux/
10 April 11, 2000 - March 15, 2004
13 #ifndef SUPERTUX_GAMELOOP_H
14 #define SUPERTUX_GAMELOOP_H
25 #define ST_GL_LOAD_GAME 2
26 #define ST_GL_LOAD_LEVEL_FILE 3
27 #define ST_GL_DEMO_GAME 4
29 extern int game_started;
33 /** The GameSession class controlls the controll flow of a World, ie.
34 present the menu on specifc keypresses, render and update it while
35 keeping the speed and framerate sane, etc. */
45 unsigned int last_update_time;
46 unsigned int update_time;
51 // FIXME: Hack for restarting the level
54 enum ExitStatus { NONE, LEVEL_FINISHED, GAME_OVER, LEVEL_ABORT };
55 ExitStatus exit_status;
59 GameSession(const std::string& subset, int levelnb, int mode);
62 /** Enter the busy loop */
66 void action(double frame_ratio);
68 Level* get_level() { return world->get_level(); }
69 World* get_world() { return world; }
71 static GameSession* current() { return current_; }
73 static GameSession* current_;
77 void check_end_conditions();
79 void process_events();
84 void drawresultscreen(void);
87 std::string slotinfo(int slot);
89 bool rectcollision(base_type* one, base_type* two);
90 void bumpbrick(float x, float y);
92 #endif /*SUPERTUX_GAMELOOP_H*/