@ -34,13 +34,14 @@ void Game::run() {
while (state != Exit) {
switch (state) {
case Start:
//start_screen.reset();
start_screen.run(font);
state = start_screen.next_state;
break;
case Gameplay:
game_screen.reset();
game_screen.run(font);
state = game_screen.next_state;
}
@ -180,10 +180,10 @@ void GameScreen::run(ALLEGRO_FONT* font) {
//Global refresh
if (objects.chk_player_col()) {
/*if (objects.chk_player_col()) {
exit_screen = true;
score += objects.chk_bullet_col();
}*/
//score += objects.chk_bullet_col();
objects.move_enemies();
al_clear_to_color(al_map_rgb(0, 0, 0));
redraw(font);
@ -15,6 +15,10 @@ StartScreen::StartScreen(std::map<std::string, ALLEGRO_BITMAP*> _sprites) {
sprites = _sprites;
void StartScreen::reset() {
//Run screen
void StartScreen::run(ALLEGRO_FONT * font) {
ALLEGRO_EVENT_QUEUE* event_queue = NULL;
@ -10,6 +10,7 @@ public:
StartScreen(std::map<std::string, ALLEGRO_BITMAP*> _sprites);
void reset();
void run(ALLEGRO_FONT* font);
void redraw(ALLEGRO_FONT* font);
void back();