Cleaned up the Code; reworked the Block Physics

This commit is contained in:
Exobyt 2024-08-27 22:35:24 +02:00
parent ed9f671256
commit 9f6750b08a
48 changed files with 1237 additions and 1116 deletions

View file

@ -1,11 +1,8 @@
[gd_scene load_steps=21 format=3 uid="uid://dwl4lotl1d3ij"]
[gd_scene load_steps=15 format=3 uid="uid://dwl4lotl1d3ij"]
[ext_resource type="Script" path="res://scenes/Grid/grid.gd" id="1_vie5m"]
[ext_resource type="Texture2D" uid="uid://cj6fsj1ac11a1" path="res://assets/background.png" id="2_vakrw"]
[ext_resource type="PackedScene" uid="uid://bm7rshwf6pjb" path="res://scenes/Grid/border.tscn" id="4_3j08q"]
[ext_resource type="PackedScene" uid="uid://duubii5uu3lgq" path="res://scenes/Grid/row_test.tscn" id="4_si3v6"]
[ext_resource type="PackedScene" uid="uid://dvrotjxom4u6d" path="res://scenes/Grid/bottom.tscn" id="5_14njh"]
[ext_resource type="PackedScene" uid="uid://d2m5xvw4ucwfw" path="res://scenes/Grid/lose_area.tscn" id="5_u5wlg"]
[ext_resource type="Script" path="res://scenes/Grid/camera_2d.gd" id="6_mbeib"]
[ext_resource type="Theme" uid="uid://1nebbd65iyce" path="res://Theme/main.tres" id="7_38u5s"]
[ext_resource type="Script" path="res://scenes/Main/control.gd" id="8_4bfjb"]
@ -15,28 +12,12 @@
[ext_resource type="Texture2D" uid="uid://ct4dkk00pyv6v" path="res://assets/Buttons/RotationLeft.png" id="12_qk3ju"]
[ext_resource type="Texture2D" uid="uid://5gbnb7gtwww3" path="res://assets/Buttons/RotationRight.png" id="13_kls78"]
[ext_resource type="Texture2D" uid="uid://cevua7g7nsrfj" path="res://assets/Buttons/DownArrow.png" id="14_i1yud"]
[ext_resource type="PackedScene" uid="uid://ibyhtfpc52vc" path="res://scenes/Grid/row_test.tscn" id="14_ogg0j"]
[ext_resource type="AudioStream" uid="uid://tf3d2uu84gf1" path="res://assets/Audio/Background.wav" id="16_ng6e7"]
[sub_resource type="QuadMesh" id="QuadMesh_qfjsc"]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_flipi"]
size = Vector2(128, 1536)
[sub_resource type="RectangleShape2D" id="RectangleShape2D_rxd0s"]
size = Vector2(896, 128)
[sub_resource type="RectangleShape2D" id="RectangleShape2D_m21a1"]
size = Vector2(640, 256)
[node name="Grid" type="Node2D"]
script = ExtResource("1_vie5m")
[node name="MeshInstance2D" type="MeshInstance2D" parent="."]
modulate = Color(0.359096, 0.426588, 0.599397, 1)
position = Vector2(320, 640)
scale = Vector2(640, 1280)
mesh = SubResource("QuadMesh_qfjsc")
[node name="TextureRect" type="TextureRect" parent="."]
offset_right = 640.0
offset_bottom = 1280.0
@ -46,106 +27,7 @@ stretch_mode = 1
[node name="Blocks" type="Node2D" parent="."]
[node name="Spawnpoint" type="Marker2D" parent="."]
position = Vector2(256, -128)
[node name="RowTests" type="Node2D" parent="."]
[node name="rowTest" parent="RowTests" instance=ExtResource("4_si3v6")]
position = Vector2(0, 1248)
[node name="rowTest2" parent="RowTests" instance=ExtResource("4_si3v6")]
position = Vector2(0, 1184)
[node name="rowTest3" parent="RowTests" instance=ExtResource("4_si3v6")]
position = Vector2(0, 1120)
[node name="rowTest4" parent="RowTests" instance=ExtResource("4_si3v6")]
position = Vector2(0, 1056)
[node name="rowTest5" parent="RowTests" instance=ExtResource("4_si3v6")]
position = Vector2(0, 992)
[node name="rowTest6" parent="RowTests" instance=ExtResource("4_si3v6")]
position = Vector2(0, 928)
[node name="rowTest7" parent="RowTests" instance=ExtResource("4_si3v6")]
position = Vector2(0, 864)
[node name="rowTest8" parent="RowTests" instance=ExtResource("4_si3v6")]
position = Vector2(0, 800)
[node name="rowTest9" parent="RowTests" instance=ExtResource("4_si3v6")]
position = Vector2(0, 736)
[node name="rowTest10" parent="RowTests" instance=ExtResource("4_si3v6")]
position = Vector2(0, 672)
[node name="rowTest11" parent="RowTests" instance=ExtResource("4_si3v6")]
position = Vector2(0, 608)
[node name="rowTest12" parent="RowTests" instance=ExtResource("4_si3v6")]
position = Vector2(0, 544)
[node name="rowTest13" parent="RowTests" instance=ExtResource("4_si3v6")]
position = Vector2(0, 480)
[node name="rowTest14" parent="RowTests" instance=ExtResource("4_si3v6")]
position = Vector2(0, 416)
[node name="rowTest15" parent="RowTests" instance=ExtResource("4_si3v6")]
position = Vector2(0, 352)
[node name="rowTest16" parent="RowTests" instance=ExtResource("4_si3v6")]
position = Vector2(0, 288)
[node name="rowTest17" parent="RowTests" instance=ExtResource("4_si3v6")]
position = Vector2(0, 224)
[node name="rowTest18" parent="RowTests" instance=ExtResource("4_si3v6")]
position = Vector2(0, 160)
[node name="rowTest19" parent="RowTests" instance=ExtResource("4_si3v6")]
position = Vector2(0, 96)
[node name="rowTest20" parent="RowTests" instance=ExtResource("4_si3v6")]
position = Vector2(0, 32)
[node name="Ticker" type="Timer" parent="."]
[node name="Patterns" type="Node2D" parent="."]
position = Vector2(256, -128)
[node name="TurnTick" type="Timer" parent="."]
wait_time = 0.1
one_shot = true
[node name="Borders" type="Node2D" parent="."]
[node name="Border" parent="Borders" groups=["LeftBorder"] instance=ExtResource("4_3j08q")]
[node name="CollisionShape2D" parent="Borders/Border" index="0" groups=["LeftBorder"]]
position = Vector2(-64, 512)
shape = SubResource("RectangleShape2D_flipi")
[node name="Border2" parent="Borders" groups=["RightBorder"] instance=ExtResource("4_3j08q")]
[node name="CollisionShape2D" parent="Borders/Border2" index="0" groups=["RightBorder"]]
position = Vector2(704, 512)
shape = SubResource("RectangleShape2D_flipi")
[node name="Bottom" parent="." groups=["Floor"] instance=ExtResource("5_14njh")]
position = Vector2(320, 1312)
collision_mask = 2
[node name="CollisionShape2D" parent="Bottom" index="0"]
position = Vector2(0, 32)
shape = SubResource("RectangleShape2D_rxd0s")
[node name="LoseArea" parent="." instance=ExtResource("5_u5wlg")]
[node name="CollisionShape2D" type="CollisionShape2D" parent="LoseArea"]
position = Vector2(320, -128)
shape = SubResource("RectangleShape2D_m21a1")
position = Vector2(288, -96)
[node name="GameTimer" type="Timer" parent="."]
@ -282,17 +164,87 @@ action_mode = 0
icon = ExtResource("14_i1yud")
icon_alignment = 1
[node name="Background" type="Sprite2D" parent="."]
position = Vector2(320, 640)
scale = Vector2(10, 20)
[node name="AudioStreamPlayer2D" type="AudioStreamPlayer2D" parent="."]
stream = ExtResource("16_ng6e7")
volume_db = 3.0
autoplay = true
[connection signal="timeout" from="Ticker" to="." method="_on_ticker_timeout"]
[connection signal="timeout" from="TurnTick" to="." method="_on_turn_tick_timeout"]
[node name="Borders" type="Node2D" parent="."]
[node name="Border" parent="Borders" instance=ExtResource("4_3j08q")]
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="Borders/Border"]
polygon = PackedVector2Array(0, -64, 0, 1280, 640, 1280, 640, -64, 1088, -64, 1088, 1536, -448, 1536, -448, -64)
[node name="RayCast2D" type="RayCast2D" parent="Borders"]
position = Vector2(32, -32)
target_position = Vector2(576, 0)
collision_mask = 2
hit_from_inside = true
[node name="Rows" type="Node2D" parent="."]
[node name="RowTest" parent="Rows" instance=ExtResource("14_ogg0j")]
position = Vector2(0, 1216)
[node name="RowTest2" parent="Rows" instance=ExtResource("14_ogg0j")]
position = Vector2(0, 1152)
[node name="RowTest3" parent="Rows" instance=ExtResource("14_ogg0j")]
position = Vector2(0, 1088)
[node name="RowTest4" parent="Rows" instance=ExtResource("14_ogg0j")]
position = Vector2(0, 1024)
[node name="RowTest5" parent="Rows" instance=ExtResource("14_ogg0j")]
position = Vector2(0, 960)
[node name="RowTest6" parent="Rows" instance=ExtResource("14_ogg0j")]
position = Vector2(0, 896)
[node name="RowTest7" parent="Rows" instance=ExtResource("14_ogg0j")]
position = Vector2(0, 832)
[node name="RowTest8" parent="Rows" instance=ExtResource("14_ogg0j")]
position = Vector2(0, 768)
[node name="RowTest9" parent="Rows" instance=ExtResource("14_ogg0j")]
position = Vector2(0, 704)
[node name="RowTest10" parent="Rows" instance=ExtResource("14_ogg0j")]
position = Vector2(0, 640)
[node name="RowTest11" parent="Rows" instance=ExtResource("14_ogg0j")]
position = Vector2(0, 576)
[node name="RowTest12" parent="Rows" instance=ExtResource("14_ogg0j")]
position = Vector2(0, 512)
[node name="RowTest13" parent="Rows" instance=ExtResource("14_ogg0j")]
position = Vector2(0, 448)
[node name="RowTest14" parent="Rows" instance=ExtResource("14_ogg0j")]
position = Vector2(0, 384)
[node name="RowTest15" parent="Rows" instance=ExtResource("14_ogg0j")]
position = Vector2(0, 320)
[node name="RowTest16" parent="Rows" instance=ExtResource("14_ogg0j")]
position = Vector2(0, 256)
[node name="RowTest17" parent="Rows" instance=ExtResource("14_ogg0j")]
position = Vector2(0, 192)
[node name="RowTest18" parent="Rows" instance=ExtResource("14_ogg0j")]
position = Vector2(0, 128)
[node name="RowTest19" parent="Rows" instance=ExtResource("14_ogg0j")]
position = Vector2(0, 64)
[node name="RowTest20" parent="Rows" instance=ExtResource("14_ogg0j")]
[node name="TestTimer" type="Timer" parent="."]
one_shot = true
[connection signal="timeout" from="GameTimer" to="." method="_on_game_timer_timeout"]
[connection signal="pressed" from="Camera2D/CanvasLayer/Control/HBoxContainer3/left_Button" to="Camera2D/CanvasLayer/Control" method="_on_left_button_pressed"]
[connection signal="pressed" from="Camera2D/CanvasLayer/Control/HBoxContainer3/right_Button" to="Camera2D/CanvasLayer/Control" method="_on_right_button_pressed"]
@ -300,7 +252,4 @@ autoplay = true
[connection signal="pressed" from="Camera2D/CanvasLayer/Control/HBoxContainer4/rotate_right_Button" to="Camera2D/CanvasLayer/Control" method="_on_rotate_right_button_pressed"]
[connection signal="button_down" from="Camera2D/CanvasLayer/Control/HBoxContainer5/down_Button" to="Camera2D/CanvasLayer/Control" method="_on_down_button_button_down"]
[connection signal="button_up" from="Camera2D/CanvasLayer/Control/HBoxContainer5/down_Button" to="Camera2D/CanvasLayer/Control" method="_on_down_button_button_up"]
[editable path="Borders/Border"]
[editable path="Borders/Border2"]
[editable path="Bottom"]
[connection signal="timeout" from="TestTimer" to="." method="_on_test_timer_timeout"]