summaryrefslogtreecommitdiff
path: root/Scripts/GameLoop.gd
diff options
context:
space:
mode:
authoraltaf-creator <dev@altafcreator.com>2024-04-15 10:04:22 +0700
committeraltaf-creator <dev@altafcreator.com>2024-04-15 10:04:22 +0700
commita2b2d15604d4e8f5b4d7717e8cfc536d8df677d2 (patch)
treea4ecf885b6d8be5f9062f505a7c38ab189b7fbd8 /Scripts/GameLoop.gd
parent074227281d6b90a70bd39eb05222d45cc5474cf3 (diff)
fix bugs, incorrect sounds on modifier, fix game finishes when ai is still calculating modifier
Diffstat (limited to 'Scripts/GameLoop.gd')
-rw-r--r--Scripts/GameLoop.gd15
1 files changed, 6 insertions, 9 deletions
diff --git a/Scripts/GameLoop.gd b/Scripts/GameLoop.gd
index 9edc99a..5d3c3f4 100644
--- a/Scripts/GameLoop.gd
+++ b/Scripts/GameLoop.gd
@@ -37,22 +37,19 @@ func _on_between_player_and_ai_timeout():
else: turn_label.text = ""
if current_turns >= turns:
+ $"AudioDelay".start()
+
+func _on_audio_delay_timeout():
win_control.visible = true
anim.play("win")
anim_label.size = Vector2(1280, 720)
- if GlobalVariables.player.get_node("..").value > GlobalVariables.ai.get_node("..").value:
- anim_label.text = "YOU won!"
- elif GlobalVariables.player.get_node("..").value < GlobalVariables.ai.get_node("..").value:
- anim_label.text = "AI won!"
- else:
- anim_label.text = "It's a TIE!"
- $"AudioDelay".start()
-
-func _on_audio_delay_timeout():
if GlobalVariables.player.get_node("..").value > GlobalVariables.ai.get_node("..").value:
+ anim_label.text = "YOU won!"
win_control.get_node("Win").play()
elif GlobalVariables.player.get_node("..").value < GlobalVariables.ai.get_node("..").value:
win_control.get_node("Lose").play()
+ anim_label.text = "AI won!"
else:
win_control.get_node("Win").play()
+ anim_label.text = "It's a TIE!"