pir-serious-game-ethics/mini-game/scenes/decor/instructionsUI.gd

35 lines
525 B
GDScript3

extends Control
# Declare member variables here. Examples:
# var a = 2
# var b = "text"
var jumped = false
func _wait_for_jump():
var t = Timer.new()
t.set_wait_time(0.5)
add_child(t)
t.start()
while(!jumped):
yield(t, "timeout")
if visible:
hide()
else:
show()
yield(t, "timeout")
hide()
func _input(event):
if event.is_action_pressed("ui_accept"):
jumped = true
# Called when the node enters the scene tree for the first time.
func _ready():
hide()
func _init():
show()
_wait_for_jump()