36 lines
1002 B
GDScript
36 lines
1002 B
GDScript
extends PanelContainer
|
|
|
|
|
|
# Called when the node enters the scene tree for the first time.
|
|
func _ready() -> void:
|
|
pass # Replace with function body.
|
|
|
|
|
|
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
|
func _process(delta: float) -> void:
|
|
pass
|
|
|
|
|
|
func _on_ui_death_menu(time: Variant, kills: Variant) -> void:
|
|
self.call_deferred("set_visible",true)
|
|
var gameTimeString:String
|
|
if time < 60.0:
|
|
gameTimeString = "Time: "+str(time)+" seconds."
|
|
elif time > 60.0:
|
|
var minutes = floori(time/60)
|
|
var seconds = time - minutes*60
|
|
if time >120.0:
|
|
gameTimeString = "Time: "+str(minutes)+" minutes and "+str(seconds)+ " seconds."
|
|
else:
|
|
gameTimeString = "Time: "+str(minutes)+" minute and "+str(seconds)+ " seconds."
|
|
$"panel/stats/game time".text = gameTimeString
|
|
$"panel/stats/killcount".text = "Kills: "+str(kills)
|
|
|
|
|
|
func _on_quit_pressed() -> void:
|
|
get_tree().quit()
|
|
|
|
|
|
func _on_try_again_pressed() -> void:
|
|
$"panel/controls/Label".call_deferred("set_visible",true)
|