diff options
Diffstat (limited to 'godot/scenes/objects/GoalTriggerBox.gd')
-rw-r--r-- | godot/scenes/objects/GoalTriggerBox.gd | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/godot/scenes/objects/GoalTriggerBox.gd b/godot/scenes/objects/GoalTriggerBox.gd index 9659520..208a2f3 100644 --- a/godot/scenes/objects/GoalTriggerBox.gd +++ b/godot/scenes/objects/GoalTriggerBox.gd @@ -1,22 +1,15 @@ extends Area -const Loader = preload("res://scenes/Game.gd") -var loader: Loader = null - -# Called when the node enters the scene tree for the first time. -func _ready(): - loader = get_node("/root/Game") +var loader -# Called every frame. 'delta' is the elapsed time since the previous frame. -#func _process(delta): -# pass +func _on_GoalTriggerZone_tree_entered(): + loader = get_node("/root/Game") -func _on_Area_body_entered(body: RigidBody): +func _on_GoalTriggerZone_body_entered(body :RigidBody): # return when body is not a rigidbody if body == null: return loader.end_level() - |