13 lines
268 B
GDScript
13 lines
268 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.start_game()
|