25 lines
470 B
GDScript
25 lines
470 B
GDScript
extends Node
|
|
|
|
signal restart
|
|
var rectangle_opacity = 0
|
|
|
|
func _ready():
|
|
# Called every time the node is added to the scene.
|
|
# Initialization here
|
|
pass
|
|
|
|
func _process(delta):
|
|
$ColorRect.color = Color(0, 0, 0, rectangle_opacity)
|
|
if rectangle_opacity < 1:
|
|
rectangle_opacity += delta/2
|
|
if (Input.is_action_pressed("ui_quit")):
|
|
get_tree().quit()
|
|
|
|
|
|
func _on_Button_pressed():
|
|
emit_signal("restart")
|
|
queue_free()
|
|
|
|
func _on_Button_button_down():
|
|
$Restart.frame = 1
|