able to spawn enemy when pressing space
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
package game
|
||||
|
||||
Enemy :: struct {
|
||||
position: Vec2,
|
||||
health: int,
|
||||
active: bool,
|
||||
}
|
||||
|
||||
spawn_enemy :: proc(world: ^World) {
|
||||
if len(world.path) == 0 do return // don't spawn enemies if no paths exist
|
||||
|
||||
world.enemy = Enemy {
|
||||
position = world.path[0],
|
||||
health = 20,
|
||||
active = true,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user