summaryrefslogtreecommitdiff
path: root/Scripts/GameLoop.gd
diff options
context:
space:
mode:
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!"