diff options
author | IcECreAm777 <31211782+IcECreAm777@users.noreply.github.com> | 2022-07-17 03:40:41 +0200 |
---|---|---|
committer | IcECreAm777 <31211782+IcECreAm777@users.noreply.github.com> | 2022-07-17 03:40:41 +0200 |
commit | d3f6967fe666595cf0862be57a3dae3bb23afd24 (patch) | |
tree | 7e6f90f9a3116431dc761fdd4167b58f4b59ec43 /godot/scenes/objects/GoalTriggerBox.gd | |
parent | 690e705de1e8b8babbb7bf86f55a5dbae559488b (diff) | |
download | 2022-d3f6967fe666595cf0862be57a3dae3bb23afd24.tar.gz 2022-d3f6967fe666595cf0862be57a3dae3bb23afd24.tar.bz2 2022-d3f6967fe666595cf0862be57a3dae3bb23afd24.zip |
asset for the goal trigger
Diffstat (limited to 'godot/scenes/objects/GoalTriggerBox.gd')
-rw-r--r-- | godot/scenes/objects/GoalTriggerBox.gd | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/godot/scenes/objects/GoalTriggerBox.gd b/godot/scenes/objects/GoalTriggerBox.gd new file mode 100644 index 0000000..9659520 --- /dev/null +++ b/godot/scenes/objects/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_Area_body_entered(body: RigidBody): + # return when body is not a rigidbody + if body == null: + return + + loader.end_level() + |