2024-07-24 20:45:32 +00:00
|
|
|
[gd_scene load_steps=2 format=3 uid="uid://clqvgh6qmglue"]
|
|
|
|
|
|
|
|
[sub_resource type="GDScript" id="GDScript_8d33s"]
|
|
|
|
resource_name = "bridge"
|
|
|
|
script/source = "extends Area2D
|
|
|
|
|
|
|
|
var wallObject : Array
|
|
|
|
|
|
|
|
# Called when the node enters the scene tree for the first time.
|
|
|
|
func _ready():
|
|
|
|
pass # Replace with function body.
|
|
|
|
|
|
|
|
|
|
|
|
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
2024-07-29 13:24:09 +00:00
|
|
|
func _process(_delta):
|
2024-07-24 20:45:32 +00:00
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
|
|
func _on_body_entered(object):
|
|
|
|
print(\"Entered %d\",object)
|
|
|
|
if (object.has_meta(\"Type\") and object.get_meta(\"Type\") == \"Player\" ):
|
|
|
|
for _object in wallObject:
|
|
|
|
_object.process_mode = Node.PROCESS_MODE_DISABLED
|
|
|
|
else:
|
|
|
|
wallObject.append(object)
|
|
|
|
|
|
|
|
|
|
|
|
func _on_body_exited(object):
|
|
|
|
if (object.has_meta(\"Type\") and object.get_meta(\"Type\") == \"Player\" ):
|
|
|
|
for _object in wallObject:
|
|
|
|
_object.process_mode = Node.PROCESS_MODE_INHERIT
|
|
|
|
"
|
|
|
|
|
|
|
|
[node name="BridgeNode" type="Area2D"]
|
|
|
|
script = SubResource("GDScript_8d33s")
|
|
|
|
|
|
|
|
[connection signal="body_entered" from="." to="." method="_on_body_entered"]
|
|
|
|
[connection signal="body_exited" from="." to="." method="_on_body_exited"]
|