crabs-game/scripts/game1/opening2_next_step_trigger.gd

13 lines
269 B
GDScript

extends Area2D
export (NodePath) var root_path : String
onready var root = get_node(root_path)
func _ready():
assert (root != null)
connect('body_entered', self, 'on_body_entered')
func on_body_entered(body : Node):
if body.name == 'Player':
root.launch_game()