shoot projectiles
This commit is contained in:
+4
-2
@@ -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)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user