AAAA
This commit is contained in:
parent
279b5e5599
commit
4f70414ed9
46 changed files with 1485 additions and 170 deletions
19
Objects/SceneTeleporter/teleporter.tscn
Normal file
19
Objects/SceneTeleporter/teleporter.tscn
Normal file
|
@ -0,0 +1,19 @@
|
|||
[gd_scene load_steps=3 format=3 uid="uid://xb5tl1a6bkkc"]
|
||||
|
||||
[ext_resource type="Script" path="res://Objects/SceneTeleporter/teleportergd.gd" id="1_l8pvx"]
|
||||
|
||||
[sub_resource type="CircleShape2D" id="CircleShape2D_wwqub"]
|
||||
|
||||
[node name="Teleporter" type="Node2D"]
|
||||
position = Vector2(-361, 264)
|
||||
script = ExtResource("1_l8pvx")
|
||||
scenePath = "res://Maps/MapTest2.tscn"
|
||||
|
||||
[node name="CollisionDetector" type="Area2D" parent="."]
|
||||
collision_layer = 0
|
||||
collision_mask = 2
|
||||
|
||||
[node name="CollisionShape" type="CollisionShape2D" parent="CollisionDetector"]
|
||||
shape = SubResource("CircleShape2D_wwqub")
|
||||
|
||||
[connection signal="body_shape_entered" from="CollisionDetector" to="." method="_on_collision_detector_body_shape_entered"]
|
9
Objects/SceneTeleporter/teleportergd.gd
Normal file
9
Objects/SceneTeleporter/teleportergd.gd
Normal file
|
@ -0,0 +1,9 @@
|
|||
extends Node2D
|
||||
|
||||
@export var scenePath := "res://"
|
||||
|
||||
func _ready():
|
||||
ResourceLoader.load_threaded_request(scenePath)
|
||||
|
||||
func _on_collision_detector_body_shape_entered(body_rid, body, body_shape_index, local_shape_index):
|
||||
get_tree().change_scene_to_file(scenePath)
|
Loading…
Add table
Add a link
Reference in a new issue