From a2b2d15604d4e8f5b4d7717e8cfc536d8df677d2 Mon Sep 17 00:00:00 2001 From: altaf-creator Date: Mon, 15 Apr 2024 10:04:22 +0700 Subject: fix bugs, incorrect sounds on modifier, fix game finishes when ai is still calculating modifier --- Scripts/GameLoop.gd | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'Scripts/GameLoop.gd') 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!" -- cgit v1.2.3