diff --git a/Assignment3Project/Assignment3Project/game_screen.cpp b/Assignment3Project/Assignment3Project/game_screen.cpp index 3529929..023f1a3 100644 --- a/Assignment3Project/Assignment3Project/game_screen.cpp +++ b/Assignment3Project/Assignment3Project/game_screen.cpp @@ -162,7 +162,7 @@ void GameScreen::run(ALLEGRO_FONT* font) { map_y -= 10; } else { - next_state = Exit; + exit_screen = true; } if (more_enemies && map_y >= next_enemy.when) { @@ -180,6 +180,10 @@ void GameScreen::run(ALLEGRO_FONT* font) { } //Global refresh + if (objects.chk_player_col()) { + exit_screen = true; + } + score += objects.chk_bullet_col(); objects.move_enemies(); al_clear_to_color(al_map_rgb(0, 0, 0)); redraw(font); @@ -281,5 +285,5 @@ void GameScreen::back() { } void GameScreen::cont() { - next_state = End; + next_state = Start; } \ No newline at end of file diff --git a/Assignment3Project/Assignment3Project/ship.cpp b/Assignment3Project/Assignment3Project/ship.cpp index 1810c3e..80861b0 100644 --- a/Assignment3Project/Assignment3Project/ship.cpp +++ b/Assignment3Project/Assignment3Project/ship.cpp @@ -3,7 +3,7 @@ Ship::Ship(Behavior _behavior) { switch (_behavior) { case Enemy: - speed = 1.2; + speed = 0.5; height = 40; width = 40; @@ -12,7 +12,7 @@ Ship::Ship(Behavior _behavior) { h_bound = SCREEN_H; break; default: - speed = 0.5; + speed = 1.0; height = 40; width = 40;