From 3623b4c0162030dd19b47d6b576dc0203844eed3 Mon Sep 17 00:00:00 2001 From: BraydonKains Date: Thu, 24 Jan 2019 17:21:17 -0500 Subject: [PATCH] Fixed a glitch --- Assignment3Project/Assignment3Project/game.cpp | 3 ++- Assignment3Project/Assignment3Project/game_screen.cpp | 6 +++--- Assignment3Project/Assignment3Project/start_screen.cpp | 4 ++++ Assignment3Project/Assignment3Project/start_screen.h | 1 + 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/Assignment3Project/Assignment3Project/game.cpp b/Assignment3Project/Assignment3Project/game.cpp index 9807274..01ab403 100644 --- a/Assignment3Project/Assignment3Project/game.cpp +++ b/Assignment3Project/Assignment3Project/game.cpp @@ -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 = start_screen.next_state; + state = game_screen.next_state; break; } } diff --git a/Assignment3Project/Assignment3Project/game_screen.cpp b/Assignment3Project/Assignment3Project/game_screen.cpp index 023f1a3..3686d1a 100644 --- a/Assignment3Project/Assignment3Project/game_screen.cpp +++ b/Assignment3Project/Assignment3Project/game_screen.cpp @@ -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); diff --git a/Assignment3Project/Assignment3Project/start_screen.cpp b/Assignment3Project/Assignment3Project/start_screen.cpp index a2e66af..9b52a01 100644 --- a/Assignment3Project/Assignment3Project/start_screen.cpp +++ b/Assignment3Project/Assignment3Project/start_screen.cpp @@ -15,6 +15,10 @@ StartScreen::StartScreen(std::map _sprites) { sprites = _sprites; } +void StartScreen::reset() { + +} + //Run screen void StartScreen::run(ALLEGRO_FONT * font) { ALLEGRO_EVENT_QUEUE* event_queue = NULL; diff --git a/Assignment3Project/Assignment3Project/start_screen.h b/Assignment3Project/Assignment3Project/start_screen.h index fd5a541..96021bd 100644 --- a/Assignment3Project/Assignment3Project/start_screen.h +++ b/Assignment3Project/Assignment3Project/start_screen.h @@ -10,6 +10,7 @@ public: StartScreen(std::map _sprites); + void reset(); void run(ALLEGRO_FONT* font); void redraw(ALLEGRO_FONT* font); void back();