17 lines
471 B
GDScript
17 lines
471 B
GDScript
extends CanvasLayer
|
|
|
|
func _ready() -> void:
|
|
process_mode = Node.PROCESS_MODE_ALWAYS
|
|
$Restart.pressed.connect(_on_restart_pressed)
|
|
|
|
func setup(time: float, coins: int, total: int) -> void:
|
|
$TimeTaken.text = "Your attempt took %.1fs" % time
|
|
$CoinsCollected.text = "You collected %d/%d coins" % [coins, total]
|
|
|
|
func _on_restart_pressed() -> void:
|
|
GameManager.health = 1
|
|
GameManager.score = 0
|
|
get_tree().paused = false
|
|
queue_free()
|
|
get_tree().reload_current_scene()
|