enemy movement and object pool
This commit is contained in:
+3
-3
@@ -7,7 +7,7 @@ World :: struct {
|
||||
base_health: int,
|
||||
world_map: Map,
|
||||
path: [dynamic]Vec2,
|
||||
enemy: Enemy,
|
||||
enemies: [MAX_ENEMIES]Enemy,
|
||||
}
|
||||
|
||||
init_world :: proc() -> World {
|
||||
@@ -27,9 +27,9 @@ update_world :: proc(world: ^World, dt: f32) {
|
||||
}
|
||||
|
||||
if rl.IsKeyPressed(.SPACE) {
|
||||
spawn_enemy(world)
|
||||
spawn_group(world, 3)
|
||||
}
|
||||
|
||||
update_enemy(world, dt)
|
||||
update_enemies(world, dt)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user