extends Node3D signal victory signal quit # Called when the node enters the scene tree for the first time. func _ready() -> void: pass # Replace with function body. # Called every frame. 'delta' is the elapsed time since the previous frame. func _process(_delta: float) -> void: pass # Quit the game on user action func _unhandled_input(event: InputEvent) -> void: if event.is_action_pressed("quit-game"): quit.emit() # if all mushrooms have been picked, # then game is over func _on_mushroom_picked() -> void: print("Player picked a mushroom!") for mushroom in $mushrooms.get_children(): if mushroom.is_picked == false: return print("Player picked all mushrooms, game over") victory.emit() func _on_victory() -> void: get_tree().change_scene_to_file("res://victory-screen.tscn") func _on_quit() -> void: get_tree().quit()