Refactor brick throwing mechanics; integrate new input handling and projectile initialization components

This commit is contained in:
2025-05-13 00:44:44 +02:00
parent 3d65daf0c5
commit c291f42531
25 changed files with 276 additions and 72 deletions

View File

@@ -1,9 +1,12 @@
[gd_scene load_steps=6 format=3 uid="uid://bymro4t7angv5"]
[gd_scene load_steps=9 format=3 uid="uid://bymro4t7angv5"]
[ext_resource type="Texture2D" uid="uid://djifxc5x0dyrw" path="res://sprites/ppc_tileset.png" id="1_1c3jb"]
[ext_resource type="Script" uid="uid://cdnwrn8v05qhi" path="res://scripts/components/bullet_component.gd" id="2_i6t5k"]
[ext_resource type="Script" uid="uid://dkmxhjtmu5xlb" path="res://scripts/components/damage_component.gd" id="3_8xipx"]
[ext_resource type="Script" uid="uid://1tnr46o1ib4u" path="res://scripts/components/out_of_screen_component.gd" id="4_rdtjq"]
[ext_resource type="Script" uid="uid://bgty7040ams6s" path="res://scripts/components/projectile_init_component.gd" id="5_2vqt8"]
[ext_resource type="Script" uid="uid://873un8agkyja" path="res://scripts/components/launch_component.gd" id="6_d0tcd"]
[ext_resource type="Script" uid="uid://cvcnfrr1udco5" path="res://scripts/components/straight_motion_component.gd" id="7_r41xl"]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_ar0xf"]
size = Vector2(16, 10)
@@ -21,13 +24,10 @@ hframes = 12
vframes = 12
frame = 80
[node name="BulletComponent" type="Node" parent="." node_paths=PackedStringArray("root", "area2d", "timer")]
[node name="BulletComponent" type="Node" parent="." node_paths=PackedStringArray("root", "area2d")]
script = ExtResource("2_i6t5k")
root = NodePath("..")
speed = 320.0
area2d = NodePath("..")
life_time = 2.0
timer = NodePath("../Timer")
[node name="VisibleOnScreenNotifier2D" type="VisibleOnScreenNotifier2D" parent="."]
position = Vector2(0, 2.38419e-07)
@@ -43,3 +43,20 @@ area2d = NodePath("..")
script = ExtResource("4_rdtjq")
visibility_notifier = NodePath("../VisibleOnScreenNotifier2D")
root = NodePath("..")
[node name="ProjectileInitComponent" type="Node" parent="." node_paths=PackedStringArray("launch_component")]
script = ExtResource("5_2vqt8")
launch_component = NodePath("../LaunchComponent")
metadata/_custom_type_script = "uid://bgty7040ams6s"
[node name="LaunchComponent" type="Node2D" parent="." node_paths=PackedStringArray("root")]
script = ExtResource("6_d0tcd")
root = NodePath(".")
speed = 180.0
metadata/_custom_type_script = "uid://873un8agkyja"
[node name="StraightMotionComponent" type="Node" parent="." node_paths=PackedStringArray("root", "launch_component")]
script = ExtResource("7_r41xl")
root = NodePath("..")
launch_component = NodePath("../LaunchComponent")
metadata/_custom_type_script = "uid://cvcnfrr1udco5"