able to spawn enemy when pressing space

This commit is contained in:
2026-06-10 02:32:01 -07:00
parent 4032a5ea76
commit d7ac123359
8 changed files with 100 additions and 7 deletions
+18
View File
@@ -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,
}
}