Initial enemy setup, with collisions and basic spawning.
Modified-by: Jason Hilder <jhilder95@gmail.com>
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user