/* --- GAME ACTION! --- */
-int game_action(void)
+int
+GameSession::action()
{
unsigned int i;
/* --- GAME DRAW! --- */
-void game_draw(void)
+void
+GameSession::draw()
{
int y,x;
while (SDL_PollEvent(&event))
{}
- game_draw();
+ draw();
do
{
jump = false;
frame_ratio = 1;
while(z >= 1)
{*/
- if (game_action() == 0)
+ if (action() == 0)
{
/* == 0: no more lives */
/* == -1: continues */
game_draw();
else
jump = true;*/ /*FIXME: Implement this tweak right.*/
- game_draw();
+ draw();
/* Time stops in pause mode */
if(game_pause || show_menu )
return(quit);
}
-
/* Load graphics/sounds shared between all levels: */
-
-void loadshared(void)
+void loadshared()
{
int i;
class GameSession
{
private:
- timer_type fps_timer, frame_timer;
+ timer_type fps_timer, frame_timer;
+
public:
GameSession(const char * subset, int levelnb, int mode);
- int run();
+ int run();
+ void draw();
+ int action();
};
void activate_bad_guys(Level* plevel);
}
}
- return (menu_width * 16 + 48);
+ return (menu_width * 16 + 24);
}
int Menu::height()
/* Draw a transparent background */
fillrect(pos_x - menu_width/2,
- pos_y - 24*num_items/2,
- menu_width,menu_height,
- 150,180,200,100);
+ pos_y - 24*num_items/2 - 10,
+ menu_width,menu_height + 20,
+ 150,180,200,125);
for(int i = 0; i < num_items; ++i)
{