door between segements are placed and rotated correctly :3
This commit is contained in:
parent
1c0fbf3d69
commit
5197d10172
7 changed files with 96 additions and 2 deletions
|
|
@ -1,11 +1,17 @@
|
|||
[gd_scene load_steps=4 format=3 uid="uid://bwoeu7ask0fck"]
|
||||
[gd_scene load_steps=7 format=3 uid="uid://bwoeu7ask0fck"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://b5cqo12km1nh3" path="res://prefabs/snake_segment.gd" id="1_3ulhv"]
|
||||
[ext_resource type="Texture2D" uid="uid://l8x3dp68yyxr" path="res://assets/segement.png" id="1_6uqch"]
|
||||
[ext_resource type="Script" uid="uid://deq18nev0kwbg" path="res://addons/godot-donut-collision-polygon-2d-7780d026ae3d4a37fe68f43cc1f97ba664dd775d/addons/donut_collision_polygon2D/donut_collision_polygon2D.gd" id="2_3ulhv"]
|
||||
[ext_resource type="Script" uid="uid://be6ituviy74ta" path="res://prefabs/door.gd" id="4_08kyq"]
|
||||
[ext_resource type="Texture2D" uid="uid://cay1k1dp8yf12" path="res://assets/door.png" id="4_34t3n"]
|
||||
|
||||
[node name="SnakeSegment" type="AnimatableBody2D"]
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_08kyq"]
|
||||
size = Vector2(24, 64)
|
||||
|
||||
[node name="SnakeSegment" type="AnimatableBody2D" node_paths=PackedStringArray("door")]
|
||||
script = ExtResource("1_3ulhv")
|
||||
door = NodePath("DoorArm")
|
||||
|
||||
[node name="Sprite2D" type="Sprite2D" parent="."]
|
||||
texture = ExtResource("1_6uqch")
|
||||
|
|
@ -15,3 +21,29 @@ polygon = PackedVector2Array(9.85808e-15, -161, 31.4095, -157.906, 61.612, -148.
|
|||
script = ExtResource("2_3ulhv")
|
||||
radius = 160.0
|
||||
metadata/_custom_type_script = "uid://deq18nev0kwbg"
|
||||
|
||||
[node name="DoorArm" type="Node2D" parent="." node_paths=PackedStringArray("this_seg")]
|
||||
script = ExtResource("4_08kyq")
|
||||
this_seg = NodePath("..")
|
||||
|
||||
[node name="Door" type="Node2D" parent="DoorArm"]
|
||||
position = Vector2(160, 0)
|
||||
scale = Vector2(1, 1)
|
||||
|
||||
[node name="DoorIn" type="Area2D" parent="DoorArm/Door"]
|
||||
position = Vector2(-16, 0)
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="DoorArm/Door/DoorIn"]
|
||||
position = Vector2(32, 0)
|
||||
shape = SubResource("RectangleShape2D_08kyq")
|
||||
|
||||
[node name="DoorOut" type="Area2D" parent="DoorArm/Door"]
|
||||
position = Vector2(16, 0)
|
||||
rotation = 3.14159
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="DoorArm/Door/DoorOut"]
|
||||
position = Vector2(32, 0)
|
||||
shape = SubResource("RectangleShape2D_08kyq")
|
||||
|
||||
[node name="Sprite2D" type="Sprite2D" parent="DoorArm/Door"]
|
||||
texture = ExtResource("4_34t3n")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue