commands, towers, etc

This commit is contained in:
2026-06-10 02:32:01 -07:00
parent 2e09dbe65d
commit 114c298219
5 changed files with 65 additions and 4 deletions
+20
View File
@@ -0,0 +1,20 @@
package game
Tower :: struct {
position: Vec2,
}
try_place_tower :: proc(world: ^World, gx, gy: int) -> bool {
if !can_build_at(&world.world_map, gx, gy) do return false
if world.gold < TOWER_COST do return false
pos := grid_to_center(gx, gy)
for t in world.towers {
if distance(t.position, pos) < 1 do return false
}
world.gold -= TOWER_COST
append(&world.towers, Tower{position = pos})
return true
}