clean up spawn test command

This commit is contained in:
2026-06-10 02:32:01 -07:00
parent 114c298219
commit dd6a5684be
2 changed files with 8 additions and 4 deletions
+8
View File
@@ -1,9 +1,11 @@
package game
import rl "vendor:raylib"
Command_Kind :: enum {
None,
Place_Tower,
Spawn_Test,
}
Command :: struct {
@@ -19,12 +21,18 @@ gather_commands :: proc(world: ^World) -> Command {
return Command{kind = .Place_Tower, gx = gx, gy = gy}
}
if rl.IsKeyPressed(.SPACE) {
return Command{kind = .Spawn_Test}
}
return Command{kind = .None}
}
execute_command :: proc(world: ^World, cmd: Command) {
switch cmd.kind {
case .None:
case .Spawn_Test:
spawn_group(world, 3)
case .Place_Tower:
try_place_tower(world, cmd.gx, cmd.gy)
}
-4
View File
@@ -26,10 +26,6 @@ update_world :: proc(world: ^World, dt: f32) {
cmd := gather_commands(world)
execute_command(world, cmd)
if rl.IsKeyPressed(.SPACE) {
spawn_group(world, 3)
}
update_enemies(world, dt)
}