Ui with timer and army count

This commit is contained in:
Victor Turgeon
2023-10-11 06:19:47 -04:00
parent 5e85af9d00
commit 58f9b64223
12 changed files with 209 additions and 16 deletions

View File

@@ -3,13 +3,12 @@ extends Node2D
var length: int = 0
var time: int = 0
var countdown: float = 0
@onready var player: Player = $Player
# Called when the node enters the scene tree for the first time.
func _ready():
length = $Music.stream.get_length()
$Time.text = str(length)
pass # Replace with function body.
player.set_time(str(length))
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
@@ -17,8 +16,7 @@ func _process(delta):
if countdown > 1:
countdown -= 1
time = $Music.get_playback_position()
$Time.text = str(length - time - 1)
pass
player.set_time(str(length - time - 1))
func win_screen():
var enemy = $Enemy