24 lines
588 B
GDScript3
24 lines
588 B
GDScript3
extends Node
|
|
|
|
signal next_screen(screen_name)
|
|
|
|
# Declare member variables here.
|
|
|
|
|
|
func _ready():
|
|
pass
|
|
|
|
func init(hasWon, score, isNewHigh):
|
|
if hasWon && isNewHigh:
|
|
$Status.text = "New High Score !"
|
|
elif hasWon:
|
|
$Status.text = "Victory !"
|
|
else:
|
|
$Status.text = "Game Over !"
|
|
$Score.text = "Score: %s" % score
|
|
|
|
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
|
func _process(_delta):
|
|
if Input.is_action_just_pressed('ui_accept') or Input.is_action_just_pressed('ui_menu'):
|
|
emit_signal("next_screen", "start")
|