fix: Scene tree timer issues
This commit is contained in:
parent
eabe566aca
commit
72060a090b
4 changed files with 4 additions and 3 deletions
|
|
@ -93,7 +93,7 @@ func spawnEnemy(enemyScene: PackedScene, laneToSpawn: int, delay: float) -> void
|
|||
var enemy : PathFollow3D = createEnemy(enemyScene)
|
||||
|
||||
if delay > 0:
|
||||
await get_tree().create_timer(delay).timeout
|
||||
await get_tree().create_timer(delay, false).timeout
|
||||
|
||||
paths[laneToSpawn].add_child(enemy)
|
||||
enemiesAlive += 1
|
||||
|
|
|
|||
|
|
@ -169,5 +169,5 @@ func toggleConnection(activate : bool) -> void:
|
|||
func disable(duration : float) -> void:
|
||||
state = STATE.DISABLED
|
||||
resting()
|
||||
await get_tree().create_timer(duration).timeout
|
||||
await get_tree().create_timer(duration, false).timeout
|
||||
state = STATE.REST
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ func updateWaveCooldownLabel(waveCooldown : float) -> void:
|
|||
else:
|
||||
$WaveCooldown.text = "\n\nNext wave : %3.1f" % waveCooldown
|
||||
waveCooldown -= tickDuration
|
||||
await get_tree().create_timer(tickDuration).timeout
|
||||
await get_tree().create_timer(tickDuration, false).timeout
|
||||
|
||||
$WaveCooldown.visible = false
|
||||
|
||||
|
|
|
|||
|
|
@ -46,6 +46,7 @@ theme = ExtResource("5_wpcnu")
|
|||
script = ExtResource("2_sac4j")
|
||||
|
||||
[node name="WaveCooldown" type="Label" parent="."]
|
||||
process_mode = 1
|
||||
layout_mode = 1
|
||||
anchors_preset = 5
|
||||
anchor_left = 0.5
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue