collisions happen properly now

This commit is contained in:
Priec
2025-11-18 01:02:13 +01:00
parent 967b377e76
commit dd410c6f6c
6 changed files with 74 additions and 54 deletions

View File

@@ -122,12 +122,12 @@ void render_loop(int speed) {
obstacle_pool[i].data.y,
obstacle_pool[i].type);
if (check_collision(draw_pos, frame.movement, obstacle_pool[i].data)) {
printf("\033[2J\033[H"); // clear screen & home cursor
printf("GAME OVER\r\n");
game_over = true;
break;
}
if (check_collision(pos, frame.movement, obstacle_pool[i].data)) {
printf("\033[2J\033[H");
printf("GAME OVER\r\n");
game_over = true;
break;
}
}
if (game_over)