aboutsummaryrefslogtreecommitdiffstats
path: root/godot/scripts
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--godot/scripts/GoalTriggerBox.gd22
1 files changed, 22 insertions, 0 deletions
diff --git a/godot/scripts/GoalTriggerBox.gd b/godot/scripts/GoalTriggerBox.gd
new file mode 100644
index 0000000..6e1034b
--- /dev/null
+++ b/godot/scripts/GoalTriggerBox.gd
@@ -0,0 +1,22 @@
+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")
+
+
+# Called every frame. 'delta' is the elapsed time since the previous frame.
+#func _process(delta):
+# pass
+
+
+func _on_Area2_body_entered(body: RigidBody):
+ # return when body is not a rigidbody
+ if body == null:
+ return
+
+ loader.end_level()
+