Ui with timer and army count
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user