diff options
author | altaf-creator <dev@altafcreator.com> | 2024-04-13 21:50:12 +0700 |
---|---|---|
committer | altaf-creator <dev@altafcreator.com> | 2024-04-13 21:50:12 +0700 |
commit | b97ebd793eb17032f3929f307dfe644b17714619 (patch) | |
tree | 03a558e77757112a6fddce45dbbcc0139df479c2 /Scripts/GameLoop.gd | |
parent | c5a806528af8a4de5f903d26cd33edb7e0bb6597 (diff) |
bare bones ai, softlock issues
Diffstat (limited to 'Scripts/GameLoop.gd')
-rw-r--r-- | Scripts/GameLoop.gd | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/Scripts/GameLoop.gd b/Scripts/GameLoop.gd index ea5e157..04cd370 100644 --- a/Scripts/GameLoop.gd +++ b/Scripts/GameLoop.gd @@ -2,10 +2,19 @@ extends Node class_name GameLoop @export var turns : int +@export var label : Label +var current_turns : int = 0 +var prev_turn : int = -1 # Called when the node enters the scene tree for the first time. func _ready(): GlobalVariables.gameloop = self func _process(_delta): - pass + if current_turns >= turns: + label.text = "FINISHED!" + + if prev_turn != current_turns: + prev_turn = current_turns + label.text = "Turns Left: " + str(turns - current_turns) + GlobalVariables.ai.step() |