Adding level and fixing collisions

Signed-off-by: Ethan Wellenreiter <ewellenreiter@gmail.com>
This commit is contained in:
Ethan Wellenreiter 2025-01-05 01:18:13 -05:00
parent 75d45f88cb
commit a70112763d
3 changed files with 219 additions and 89 deletions

View File

@ -8,6 +8,7 @@ script = ExtResource("1_p3r4l")
[node name="RayCast2D" type="RayCast2D" parent="."]
target_position = Vector2(1e+06, 0)
collision_mask = 6
[node name="Sprites" type="Node2D" parent="."]
scale = Vector2(0.05, 0.05)

View File

@ -83,7 +83,9 @@ animations = [{
[node name="Player" type="CharacterBody2D" parent="."]
unique_name_in_owner = true
collision_mask = 7
script = ExtResource("1_x227h")
SWING_SWAY = 250.0
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="Player"]
scale = Vector2(0.0729065, 0.0729065)
@ -104,6 +106,7 @@ shape = ExtResource("14_fhcn0")
[node name="RayCast2D" type="RayCast2D" parent="Player"]
target_position = Vector2(1e+06, 0)
collision_mask = 6
collide_with_areas = true
script = ExtResource("3_n7yd4")

View File

@ -1,27 +1,61 @@
[gd_scene load_steps=11 format=3 uid="uid://dojvn2guqhhel"]
[gd_scene load_steps=23 format=3 uid="uid://dojvn2guqhhel"]
[ext_resource type="Texture2D" uid="uid://b48bhtfvrv7rc" path="res://assets/background.png" id="1_t0pgr"]
[ext_resource type="PackedScene" uid="uid://brhc07imuholv" path="res://player/player.tscn" id="2_fpbhy"]
[ext_resource type="Texture2D" uid="uid://d0oq3rgb204fl" path="res://assets/ground.png" id="3_rvbjd"]
[ext_resource type="Script" path="res://world/world_level/area_2d.gd" id="4_nedwe"]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_ptfhu"]
size = Vector2(1980, 26)
[sub_resource type="RectangleShape2D" id="RectangleShape2D_aqnnp"]
size = Vector2(1980, 621)
[sub_resource type="RectangleShape2D" id="RectangleShape2D_1iolf"]
size = Vector2(1965, 598)
[sub_resource type="RectangleShape2D" id="RectangleShape2D_1q5cw"]
size = Vector2(1974, 298.559)
[sub_resource type="RectangleShape2D" id="RectangleShape2D_d8lc8"]
size = Vector2(243.5, 11.0001)
[ext_resource type="Script" path="res://world/world_level/restart.gd" id="6_ofc0n"]
[ext_resource type="Texture2D" uid="uid://ghr8vqrtxhhh" path="res://assets/level.png" id="6_robgp"]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_kwtnh"]
size = Vector2(921, 674)
size = Vector2(84, 98)
[sub_resource type="RectangleShape2D" id="RectangleShape2D_l45ry"]
size = Vector2(56, 844)
[sub_resource type="RectangleShape2D" id="RectangleShape2D_dfky3"]
size = Vector2(132, 543)
[sub_resource type="RectangleShape2D" id="RectangleShape2D_n4mk8"]
size = Vector2(358, 120)
[sub_resource type="RectangleShape2D" id="RectangleShape2D_rdgdg"]
size = Vector2(447, 106)
[sub_resource type="RectangleShape2D" id="RectangleShape2D_lmq74"]
size = Vector2(123.75, 1316)
[sub_resource type="RectangleShape2D" id="RectangleShape2D_7tcn3"]
size = Vector2(2058, 494)
[sub_resource type="RectangleShape2D" id="RectangleShape2D_7erad"]
size = Vector2(263, 107)
[sub_resource type="RectangleShape2D" id="RectangleShape2D_nnsgj"]
size = Vector2(588.5, 107.5)
[sub_resource type="RectangleShape2D" id="RectangleShape2D_aw6qs"]
size = Vector2(844, 8)
[sub_resource type="RectangleShape2D" id="RectangleShape2D_8ecfe"]
size = Vector2(165, 63)
[sub_resource type="RectangleShape2D" id="RectangleShape2D_cla8w"]
size = Vector2(7, 2232)
[sub_resource type="RectangleShape2D" id="RectangleShape2D_otqvd"]
size = Vector2(465, 94)
[sub_resource type="RectangleShape2D" id="RectangleShape2D_toy5f"]
size = Vector2(63, 52)
[sub_resource type="RectangleShape2D" id="RectangleShape2D_qqh8h"]
size = Vector2(400, 155.5)
[sub_resource type="RectangleShape2D" id="RectangleShape2D_n0ef0"]
size = Vector2(678, 106)
[sub_resource type="WorldBoundaryShape2D" id="WorldBoundaryShape2D_ca25a"]
distance = -10000.0
[node name="Level" type="Node2D"]
@ -35,80 +69,172 @@ texture = ExtResource("1_t0pgr")
stretch_mode = 1
[node name="CharacterBody2D" parent="." instance=ExtResource("2_fpbhy")]
position = Vector2(397, -187)
position = Vector2(399, -189)
[node name="Walls_and_ground" type="StaticBody2D" parent="."]
position = Vector2(574.5, 200.5)
[node name="CollisionShape2D" type="CollisionShape2D" parent="Walls_and_ground"]
position = Vector2(-44.5, -197.5)
shape = SubResource("RectangleShape2D_ptfhu")
[node name="TextureRect" type="TextureRect" parent="Walls_and_ground"]
offset_left = -1036.5
offset_top = -215.5
offset_right = 953.5
offset_bottom = -200.5
texture = ExtResource("3_rvbjd")
[node name="Walls_and_ground3" type="StaticBody2D" parent="."]
position = Vector2(574.5, 200.5)
[node name="CollisionShape2D" type="CollisionShape2D" parent="Walls_and_ground3"]
position = Vector2(1526.5, -525)
shape = SubResource("RectangleShape2D_aqnnp")
[node name="TextureRect" type="TextureRect" parent="Walls_and_ground3"]
offset_left = 551.5
offset_top = -1475.5
offset_right = 2541.5
offset_bottom = -1460.5
rotation = 1.5708
texture = ExtResource("3_rvbjd")
[node name="Walls_and_ground2" type="StaticBody2D" parent="."]
position = Vector2(574.5, 200.5)
[node name="CollisionShape2D" type="CollisionShape2D" parent="Walls_and_ground2"]
position = Vector2(-76, -1138.5)
shape = SubResource("RectangleShape2D_1iolf")
[node name="TextureRect" type="TextureRect" parent="Walls_and_ground2"]
offset_left = -1068.5
offset_top = -849.5
offset_right = 921.5
offset_bottom = -834.5
texture = ExtResource("3_rvbjd")
[node name="Walls_and_ground4" type="StaticBody2D" parent="."]
position = Vector2(-1062.73, -746.059)
[node name="CollisionShape2D" type="CollisionShape2D" parent="Walls_and_ground4"]
position = Vector2(-3.27148, 143.78)
shape = SubResource("RectangleShape2D_1q5cw")
[node name="Sprite2D" type="Sprite2D" parent="Walls_and_ground4"]
position = Vector2(1.5, 290.5)
texture = ExtResource("3_rvbjd")
[node name="Walls_and_ground5" type="StaticBody2D" parent="."]
position = Vector2(-216, -320)
[node name="CollisionShape2D" type="CollisionShape2D" parent="Walls_and_ground5"]
position = Vector2(137.979, 875.559)
shape = SubResource("RectangleShape2D_d8lc8")
[node name="Sprite2D" type="Sprite2D" parent="Walls_and_ground5"]
position = Vector2(137.479, 875.059)
scale = Vector2(0.122864, 1)
texture = ExtResource("3_rvbjd")
[node name="Area2D" type="Area2D" parent="."]
[node name="GoalArea" type="Area2D" parent="."]
collision_layer = 32768
script = ExtResource("4_nedwe")
[node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D"]
position = Vector2(-2272, -117)
[node name="CollisionShape2D" type="CollisionShape2D" parent="GoalArea"]
position = Vector2(-959, 3024)
shape = SubResource("RectangleShape2D_kwtnh")
[connection signal="body_entered" from="Area2D" to="Area2D" method="_on_body_entered"]
[node name="Sprite2D" type="Sprite2D" parent="."]
position = Vector2(-1865, 1834)
texture = ExtResource("6_robgp")
[node name="Walls" type="Node2D" parent="."]
[node name="StaticBody2D" type="StaticBody2D" parent="Walls"]
collision_layer = 2
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="Walls/StaticBody2D"]
polygon = PackedVector2Array(616, 2308, 621, 2205, 621, -106, 114, -106, 114, 362, -303, 362, -303, -372, -739, -372, -739, -380, -296, -380, -296, 355, 107, 355, 107, -113, 635, -113, 635, -106, 628, -106, 628, 2274, 619, 4265, 606, 4265, 609, 3135, -864, 2741, -864, 2272, -1057, 2273, -1057, 2257, -775, 2259, 493, 2380, 599, 2319)
[node name="StaticBody2D2" type="StaticBody2D" parent="Walls"]
collision_layer = 2
[node name="CollisionShape2D" type="CollisionShape2D" parent="Walls/StaticBody2D2"]
position = Vector2(-1085, 2680)
shape = SubResource("RectangleShape2D_l45ry")
[node name="StaticBody2D4" type="StaticBody2D" parent="Walls"]
collision_layer = 2
[node name="CollisionShape2D" type="CollisionShape2D" parent="Walls/StaticBody2D4"]
position = Vector2(-1149, 2840.5)
shape = SubResource("RectangleShape2D_dfky3")
[node name="StaticBody2D3" type="StaticBody2D" parent="Walls"]
collision_layer = 2
[node name="CollisionShape2D" type="CollisionShape2D" parent="Walls/StaticBody2D3"]
position = Vector2(-1036, 3127)
shape = SubResource("RectangleShape2D_n4mk8")
[node name="StaticBody2D5" type="StaticBody2D" parent="Walls"]
collision_layer = 2
[node name="CollisionShape2D" type="CollisionShape2D" parent="Walls/StaticBody2D5"]
position = Vector2(-1297.5, 2622)
shape = SubResource("RectangleShape2D_rdgdg")
[node name="StaticBody2D6" type="StaticBody2D" parent="Walls"]
collision_layer = 2
[node name="CollisionShape2D" type="CollisionShape2D" parent="Walls/StaticBody2D6"]
position = Vector2(-1459.88, 2017)
shape = SubResource("RectangleShape2D_lmq74")
[node name="StaticBody2D7" type="StaticBody2D" parent="Walls"]
collision_layer = 2
[node name="CollisionShape2D" type="CollisionShape2D" parent="Walls/StaticBody2D7"]
position = Vector2(-2427, 1606)
shape = SubResource("RectangleShape2D_7tcn3")
[node name="StaticBody2D8" type="StaticBody2D" parent="Walls"]
collision_layer = 2
[node name="CollisionShape2D" type="CollisionShape2D" parent="Walls/StaticBody2D8"]
position = Vector2(-3324.5, 1345.5)
shape = SubResource("RectangleShape2D_7erad")
[node name="StaticBody2D9" type="StaticBody2D" parent="Walls"]
collision_layer = 2
[node name="CollisionShape2D" type="CollisionShape2D" parent="Walls/StaticBody2D9"]
position = Vector2(-2183.25, 1342.75)
shape = SubResource("RectangleShape2D_nnsgj")
[node name="StaticBody2D10" type="StaticBody2D" parent="Walls"]
collision_layer = 2
[node name="CollisionShape2D" type="CollisionShape2D" parent="Walls/StaticBody2D10"]
position = Vector2(-2835, 604)
shape = SubResource("RectangleShape2D_aw6qs")
[node name="StaticBody2D11" type="StaticBody2D" parent="Walls"]
collision_layer = 2
[node name="CollisionShape2D" type="CollisionShape2D" parent="Walls/StaticBody2D11"]
position = Vector2(-10.5, -634.5)
shape = SubResource("RectangleShape2D_8ecfe")
[node name="StaticBody2D13" type="StaticBody2D" parent="Walls"]
collision_layer = 2
[node name="CollisionShape2D" type="CollisionShape2D" parent="Walls/StaticBody2D13"]
position = Vector2(-1102.5, 450)
shape = SubResource("RectangleShape2D_cla8w")
[node name="StaticBody2D14" type="StaticBody2D" parent="Walls"]
collision_layer = 2
[node name="CollisionShape2D" type="CollisionShape2D" parent="Walls/StaticBody2D14"]
position = Vector2(-874.5, 1586)
shape = SubResource("RectangleShape2D_otqvd")
[node name="StaticBody2D12" type="StaticBody2D" parent="Walls"]
collision_layer = 2
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="Walls/StaticBody2D12"]
polygon = PackedVector2Array(-1275, 621, -1265, 522, -1397, 510, -1412, 622)
[node name="StaticBody2D15" type="StaticBody2D" parent="Walls"]
collision_layer = 2
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="Walls/StaticBody2D15"]
polygon = PackedVector2Array(619, 4268, -3373, 4268, -3373, 2815, -4225, 2815, -4224, -666, -4216, -666, -4217, 2808, -3367, 2808, -3367, 4261, 619, 4261)
[node name="StaticBody2D16" type="StaticBody2D" parent="Walls"]
collision_layer = 2
[node name="CollisionShape2D" type="CollisionShape2D" parent="Walls/StaticBody2D16"]
position = Vector2(4.5, -401)
shape = SubResource("RectangleShape2D_toy5f")
[node name="Hazards" type="Node2D" parent="."]
script = ExtResource("6_ofc0n")
[node name="StaticBody2D" type="Area2D" parent="Hazards"]
collision_layer = 4
[node name="CollisionShape2D" type="CollisionShape2D" parent="Hazards/StaticBody2D"]
position = Vector2(-860, 1492.75)
shape = SubResource("RectangleShape2D_qqh8h")
[node name="StaticBody2D2" type="Area2D" parent="Hazards"]
collision_layer = 4
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="Hazards/StaticBody2D2"]
polygon = PackedVector2Array(-1114, 2262, -1117, 2262, -1117, 2258, -1052, 2175, -947, 2198, -945, 2199, -913, 2165, -501, 2195, -452, 2115, -66, 2148, 560, 2213, 593, 2178, 620, 2181, 617, 2256, -551, 2257, -1037, 2257)
[node name="Area2D" type="Area2D" parent="Hazards"]
collision_layer = 4
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="Hazards/Area2D"]
polygon = PackedVector2Array(-3363, 4260, -3229, 4080, -3065, 4099, -3003, 4103, -2866, 4107, -2728, 4127, -2637, 4130, -2575, 4135, -2450, 4120, -2374, 4111, -2194, 4138, -2079, 4114, -1980, 4122, -1878, 4115, -1791, 4136, -1704, 4137, -1634, 4142, -1591, 4122, -1486, 4101, -1392, 4109, -1297, 4107, -1137, 4098, -966, 4054, -818, 4083, -685, 4086, -574, 4065, -497, 4098, -384, 4096, -52, 4090, 95, 4072, 280, 4032, 413, 4031, 501, 4049, 614, 4249, 168, 4258, -3092, 4220)
[node name="Area2D2" type="Area2D" parent="Hazards"]
collision_layer = 4
[node name="CollisionShape2D" type="CollisionShape2D" parent="Hazards/Area2D2"]
position = Vector2(-2837, 1347)
shape = SubResource("RectangleShape2D_n0ef0")
[node name="Out_of_Bounds" type="Node2D" parent="."]
script = ExtResource("6_ofc0n")
[node name="Bottom" type="Area2D" parent="Out_of_Bounds"]
collision_layer = 256
[node name="CollisionShape2D" type="CollisionShape2D" parent="Out_of_Bounds/Bottom"]
shape = SubResource("WorldBoundaryShape2D_ca25a")
[connection signal="body_entered" from="GoalArea" to="GoalArea" method="_on_body_entered"]
[connection signal="body_entered" from="Hazards/StaticBody2D" to="Hazards" method="_on_body_entered"]
[connection signal="body_entered" from="Hazards/StaticBody2D2" to="Hazards" method="_on_body_entered"]
[connection signal="body_entered" from="Hazards/Area2D" to="Hazards" method="_on_body_entered"]
[connection signal="body_entered" from="Hazards/Area2D2" to="Hazards" method="_on_body_entered"]
[connection signal="body_entered" from="Out_of_Bounds/Bottom" to="Out_of_Bounds" method="_on_body_entered"]