I am doing the tutorial for the 2D game 'Dodge the Creeps!' from the tutorials here in godot. The game will start straight from boot. The HUD options or Start stays on screen and is not clickable to make it go away. I believe this is because of my signal. It must be activated from when the game is loaded and not when the Start button is pressed. When it is game over, the game will close out and bring me back to the GD environment.
extends CanvasLayer
signal start_game
func show_message(text):
$Message.text = text
$Message.show()
$MessageTimer.start()
func showgameover():
show_message("Game Over!")
#Wait until MessageTimer counts down
yield($MessageTimer, "timeout")
$MessageTimer.text = "Dodge the\nCreeps!"
$Message.show()
#make a one shot timer and wait for it to finish
yield(get_tree().create_timer(1), "timeout")
$StartButton.show()
func update_score(score):
$ScoreLabel.text = str(score)
func onStartButtonpressed():
$StartButton.hide()
emitsignal("start_game")
func onMessageTimer_timeout():
$Message.hide()
# Called when the node enters the scene tree for the first time.
func _ready():
pass # Replace with function body.