diff options
author | jacopograndi <jacopo.grandi@outlook.it> | 2022-01-17 19:41:46 +0100 |
---|---|---|
committer | jacopograndi <jacopo.grandi@outlook.it> | 2022-01-17 19:41:46 +0100 |
commit | f75ee64e21f67b4f27404147aedaa63750058d5a (patch) | |
tree | 8e35f5b0ca986169e46ef1f90c3fdd951a9af113 /scripts/control.gd | |
parent | a7bda4264b45c0c64fd81ac91b4f1fbbc539e314 (diff) |
wave
Diffstat (limited to 'scripts/control.gd')
-rw-r--r-- | scripts/control.gd | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/scripts/control.gd b/scripts/control.gd index 8ef1ff0..a2d7d2b 100644 --- a/scripts/control.gd +++ b/scripts/control.gd @@ -7,11 +7,13 @@ var selected = "" var editing_turret = "" var gui : Node +var wave : Node var player : Node var placer : Node var resources : Node var pointer : Node var turret_holder : Node +var enemies_holder : Node var load_turrets : Node var path : Node var world : VoxelMesh @@ -19,6 +21,7 @@ var world : VoxelMesh func fetch (): if load_turrets != null: return var root = get_tree().root.get_node("world") + wave = root.get_node("wave") player = root.get_node("player") resources = player.get_node("resources") placer = player.get_node("placer") @@ -27,6 +30,7 @@ func fetch (): world = root.get_node("world") path = root.get_node("path") turret_holder = root.get_node("turrets") + enemies_holder = root.get_node("enemies") var saveload = root.get_node("saveload") load_turrets = saveload.get_node("load_turrets") if !load_turrets.loaded: yield(load_turrets, "done_loading") @@ -86,7 +90,7 @@ func sell (turr_name): turr.transform.origin, turr.transform.basis.get_rotation_quat()) func _refresh (): - gui.refresh(ineditor) + gui.refresh() pointer.refresh(state, statetype, selected) func to_pick (): @@ -203,10 +207,11 @@ func do (action, par = {}): func gui_editor_toggle_event (): ineditor = !ineditor - gui.refresh(ineditor) + gui.refresh() path.refresh_path(ineditor) func gui_start_wave_event (): + if wave.ongoing: return path.refresh_path(ineditor) - #_enemies.spawn() - gui.refresh(ineditor) + wave.start() + gui.refresh() |