Initial enemy setup, with collisions and basic spawning.

Modified-by: Jason Hilder <jhilder95@gmail.com>
This commit is contained in:
2026-07-23 08:34:46 +02:00
parent 2282947c82
commit 5da084391e
7 changed files with 153 additions and 13 deletions
+15
View File
@@ -171,6 +171,21 @@ check_map_collision :: proc(rect: rl.Rectangle, game_map: Game_Map) -> bool {
return false
}
// true when collision found
check_enemy_collision :: proc(rect_a: rl.Rectangle, active_enemies: int, enemies: ^[MAX_ENEMIES]Enemy) -> bool {
for idx in 0..<active_enemies {
e := enemies[idx]
enemy_rect := get_enemy_collider(e, e.position)
if rl.CheckCollisionRecs(rect_a, enemy_rect) {
return true
}
}
return false
}
draw_map :: proc(current_map: Game_Map) {
for value, index in current_map.data {
row := index / current_map.width