Fixed a glitch

main
BraydonKains 6 years ago
parent 12ffc7333a
commit 3623b4c016

@ -34,13 +34,14 @@ void Game::run() {
while (state != Exit) { while (state != Exit) {
switch (state) { switch (state) {
case Start: case Start:
//start_screen.reset();
start_screen.run(font); start_screen.run(font);
state = start_screen.next_state; state = start_screen.next_state;
break; break;
case Gameplay: case Gameplay:
game_screen.reset(); game_screen.reset();
game_screen.run(font); game_screen.run(font);
state = start_screen.next_state; state = game_screen.next_state;
break; break;
} }
} }

@ -180,10 +180,10 @@ void GameScreen::run(ALLEGRO_FONT* font) {
} }
//Global refresh //Global refresh
if (objects.chk_player_col()) { /*if (objects.chk_player_col()) {
exit_screen = true; exit_screen = true;
} }*/
score += objects.chk_bullet_col(); //score += objects.chk_bullet_col();
objects.move_enemies(); objects.move_enemies();
al_clear_to_color(al_map_rgb(0, 0, 0)); al_clear_to_color(al_map_rgb(0, 0, 0));
redraw(font); redraw(font);

@ -15,6 +15,10 @@ StartScreen::StartScreen(std::map<std::string, ALLEGRO_BITMAP*> _sprites) {
sprites = _sprites; sprites = _sprites;
} }
void StartScreen::reset() {
}
//Run screen //Run screen
void StartScreen::run(ALLEGRO_FONT * font) { void StartScreen::run(ALLEGRO_FONT * font) {
ALLEGRO_EVENT_QUEUE* event_queue = NULL; ALLEGRO_EVENT_QUEUE* event_queue = NULL;

@ -10,6 +10,7 @@ public:
StartScreen(std::map<std::string, ALLEGRO_BITMAP*> _sprites); StartScreen(std::map<std::string, ALLEGRO_BITMAP*> _sprites);
void reset();
void run(ALLEGRO_FONT* font); void run(ALLEGRO_FONT* font);
void redraw(ALLEGRO_FONT* font); void redraw(ALLEGRO_FONT* font);
void back(); void back();

Loading…
Cancel
Save