diff options
author | IcECreAm777 <31211782+IcECreAm777@users.noreply.github.com> | 2022-07-17 16:07:47 +0200 |
---|---|---|
committer | IcECreAm777 <31211782+IcECreAm777@users.noreply.github.com> | 2022-07-17 16:07:47 +0200 |
commit | 48d4f9de2536be2617aec3d58697a0db061d038c (patch) | |
tree | 0a6cea93fd383891223ade22196b76b6b46a885c /godot/scenes/objects | |
parent | 55a6ea0d4e550af312e3d66799ac226623653b65 (diff) | |
download | 2022-48d4f9de2536be2617aec3d58697a0db061d038c.tar.gz 2022-48d4f9de2536be2617aec3d58697a0db061d038c.tar.bz2 2022-48d4f9de2536be2617aec3d58697a0db061d038c.zip |
level loading is supported now
Diffstat (limited to 'godot/scenes/objects')
-rw-r--r-- | godot/scenes/objects/GoalTriggerBox.gd | 15 | ||||
-rw-r--r-- | godot/scenes/objects/GoalZone.tscn | 1 |
2 files changed, 5 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() - diff --git a/godot/scenes/objects/GoalZone.tscn b/godot/scenes/objects/GoalZone.tscn index 79b8624..cc8c77d 100644 --- a/godot/scenes/objects/GoalZone.tscn +++ b/godot/scenes/objects/GoalZone.tscn @@ -3,6 +3,7 @@ [ext_resource path="res://scenes/objects/GoalTriggerBox.gd" type="Script" id=1] [sub_resource type="BoxShape" id=1] +extents = Vector3( 0.204243, 0.204176, 0.204328 ) [node name="GoalZone" type="Area"] script = ExtResource( 1 ) |