mirror of
https://github.com/Relintai/the_tower.git
synced 2024-11-14 10:27:21 +01:00
17 lines
339 B
GDScript
17 lines
339 B
GDScript
extends Area
|
|
|
|
|
|
func _ready():
|
|
connect("body_entered", self, "on_body_entered")
|
|
|
|
func on_body_entered(body):
|
|
if body.has_method("is_player"):
|
|
if body.is_player():
|
|
var parent : Node = get_parent()
|
|
while parent != null:
|
|
if parent.has_method("next_level"):
|
|
parent.next_level()
|
|
return
|
|
parent = parent.get_parent()
|
|
|