shoot projectiles

This commit is contained in:
2026-06-13 23:33:03 -07:00
parent 5f3ef33b05
commit b9235246c7
6 changed files with 123 additions and 26 deletions
+4 -2
View File
@@ -1,7 +1,5 @@
package game
import "core:fmt"
import rl "vendor:raylib"
World :: struct {
gold: int,
base_health: int,
@@ -13,6 +11,7 @@ World :: struct {
phase: Game_Phase,
wave: int,
spawner: Wave_Spawner,
projectiles: [MAX_PROJECTILES]Projectile,
}
init_world :: proc() -> World {
@@ -28,13 +27,16 @@ init_world :: proc() -> World {
// update world, never draw
update_world :: proc(world: ^World, dt: f32) {
if world.phase == .Game_Over || world.phase == .Victory do return
cmd := gather_commands(world)
execute_command(world, cmd)
update_wave(world, dt)
update_enemies(world, dt)
update_projectiles(world, dt)
update_towers(world, dt)
update_phase(world)
process_events(world)
check_end(world)
}