shit is bugged trying to do hit detection

main
Braydon Kains 6 years ago
parent f266425a2f
commit 12ffc7333a

@ -162,7 +162,7 @@ void GameScreen::run(ALLEGRO_FONT* font) {
map_y -= 10; map_y -= 10;
} }
else { else {
next_state = Exit; exit_screen = true;
} }
if (more_enemies && map_y >= next_enemy.when) { if (more_enemies && map_y >= next_enemy.when) {
@ -180,6 +180,10 @@ void GameScreen::run(ALLEGRO_FONT* font) {
} }
//Global refresh //Global refresh
if (objects.chk_player_col()) {
exit_screen = true;
}
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);
@ -281,5 +285,5 @@ void GameScreen::back() {
} }
void GameScreen::cont() { void GameScreen::cont() {
next_state = End; next_state = Start;
} }

@ -3,7 +3,7 @@
Ship::Ship(Behavior _behavior) { Ship::Ship(Behavior _behavior) {
switch (_behavior) { switch (_behavior) {
case Enemy: case Enemy:
speed = 1.2; speed = 0.5;
height = 40; height = 40;
width = 40; width = 40;
@ -12,7 +12,7 @@ Ship::Ship(Behavior _behavior) {
h_bound = SCREEN_H; h_bound = SCREEN_H;
break; break;
default: default:
speed = 0.5; speed = 1.0;
height = 40; height = 40;
width = 40; width = 40;

Loading…
Cancel
Save