aboutsummaryrefslogtreecommitdiffstats
path: root/godot/scripts/GoalTriggerBox.gd
diff options
context:
space:
mode:
authorLibravatar IcECreAm777 <31211782+IcECreAm777@users.noreply.github.com>2022-07-16 21:09:11 +0200
committerLibravatar IcECreAm777 <31211782+IcECreAm777@users.noreply.github.com>2022-07-16 21:09:11 +0200
commit9c061b9997d0add3298b1230426dd7332b91420f (patch)
treee26c6f23178e6dc3078ddc1948cd37180336e7d4 /godot/scripts/GoalTriggerBox.gd
parent28e29e51e2c48868d0a75586ba3f8d73858342e3 (diff)
download2022-9c061b9997d0add3298b1230426dd7332b91420f.tar.gz
2022-9c061b9997d0add3298b1230426dd7332b91420f.tar.bz2
2022-9c061b9997d0add3298b1230426dd7332b91420f.zip
goal post hitbox and level loader in gd script
Diffstat (limited to 'godot/scripts/GoalTriggerBox.gd')
-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..9281f0f
--- /dev/null
+++ b/godot/scripts/GoalTriggerBox.gd
@@ -0,0 +1,22 @@
+extends Area
+
+const Loader = preload("res://scripts/LevelLoader.gd")
+var loader: Loader = null
+
+# Called when the node enters the scene tree for the first time.
+func _ready():
+ loader = get_node("../LevelLoader")
+
+
+# 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.load_next_level()
+