Add charge throw mechanics; refactor bullet and brick components

This commit is contained in:
2025-05-12 23:08:54 +02:00
parent b09bee9fb6
commit 59c309409c
34 changed files with 422 additions and 96 deletions

View File

@@ -1,8 +1,9 @@
[gd_scene load_steps=5 format=3 uid="uid://bymro4t7angv5"]
[gd_scene load_steps=6 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://bh2vrkdbrtpin" path="res://scripts/components/bullet.gd" id="2_i6t5k"]
[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"]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_ar0xf"]
size = Vector2(16, 10)
@@ -20,12 +21,11 @@ hframes = 12
vframes = 12
frame = 80
[node name="BulletComponent" type="Node" parent="." node_paths=PackedStringArray("root", "area2d", "visibility_notifier", "timer")]
[node name="BulletComponent" type="Node" parent="." node_paths=PackedStringArray("root", "area2d", "timer")]
script = ExtResource("2_i6t5k")
root = NodePath("..")
speed = 320.0
area2d = NodePath("..")
visibility_notifier = NodePath("../VisibleOnScreenNotifier2D")
life_time = 2.0
timer = NodePath("../Timer")
@@ -38,3 +38,8 @@ scale = Vector2(0.8, 0.5)
[node name="DamageComponent" type="Node" parent="." node_paths=PackedStringArray("area2d")]
script = ExtResource("3_8xipx")
area2d = NodePath("..")
[node name="OutOfScreenComponent" type="Node" parent="." node_paths=PackedStringArray("visibility_notifier", "root")]
script = ExtResource("4_rdtjq")
visibility_notifier = NodePath("../VisibleOnScreenNotifier2D")
root = NodePath("..")

View File

@@ -1,4 +1,4 @@
[gd_scene load_steps=30 format=3 uid="uid://bqi5s710xb1ju"]
[gd_scene load_steps=32 format=3 uid="uid://bqi5s710xb1ju"]
[ext_resource type="Script" uid="uid://ccuddyoakg04u" path="res://scripts/player.gd" id="1_8j4h4"]
[ext_resource type="Texture2D" uid="uid://b7gp0gqvkv8j4" path="res://sprites/MrBrick_base.png" id="2_bc55y"]
@@ -26,6 +26,8 @@
[ext_resource type="Script" uid="uid://bya240e627ti6" path="res://scripts/resources/skill_data.gd" id="21_d0oiv"]
[ext_resource type="Resource" uid="uid://d3bjre2etov1n" path="res://resources/skills/magnetic.tres" id="22_vnsgd"]
[ext_resource type="Script" uid="uid://bjsyeo1n7bsri" path="res://scripts/components/skill_unlocker_component.gd" id="23_qsv2c"]
[ext_resource type="Script" uid="uid://c6fclevp3peuo" path="res://scripts/components/charge_throw_component.gd" id="27_h8c1m"]
[ext_resource type="PackedScene" uid="uid://bg76mtpcmfm2j" path="res://objects/ui/charging_bar_layer.tscn" id="28_3f5nm"]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_hdsg1"]
size = Vector2(16, 31)
@@ -157,5 +159,16 @@ stream = ExtResource("19_7anly")
[node name="sfx_heal" type="AudioStreamPlayer2D" parent="."]
stream = ExtResource("20_bptj5")
[node name="ChargeThrowComponent" type="Node" parent="."]
script = ExtResource("27_h8c1m")
metadata/_custom_type_script = "uid://c6fclevp3peuo"
[node name="ChargingBarLayer" parent="." node_paths=PackedStringArray("charge_throw_component") instance=ExtResource("28_3f5nm")]
offset_left = -17.0
offset_top = -30.0
offset_right = 23.0
offset_bottom = -20.0
charge_throw_component = NodePath("../ChargeThrowComponent")
[connection signal="on_death" from="HealthComponent" to="PlayerDeathComponent" method="_on_health_component_on_death"]
[connection signal="on_health_change" from="HealthComponent" to="KnockbackComponent" method="_on_health_component_on_health_change"]

View File

@@ -1,8 +1,12 @@
[gd_scene load_steps=5 format=3 uid="uid://bhc7y4xugu4q7"]
[gd_scene load_steps=9 format=3 uid="uid://bhc7y4xugu4q7"]
[ext_resource type="Texture2D" uid="uid://djifxc5x0dyrw" path="res://sprites/ppc_tileset.png" id="1_w543f"]
[ext_resource type="Script" uid="uid://dkmxhjtmu5xlb" path="res://scripts/components/damage_component.gd" id="2_ll0xw"]
[ext_resource type="Script" uid="uid://bh2vrkdbrtpin" path="res://scripts/components/bullet.gd" id="3_keogl"]
[ext_resource type="Script" uid="uid://cdnwrn8v05qhi" path="res://scripts/components/bullet_component.gd" id="3_keogl"]
[ext_resource type="Script" uid="uid://1tnr46o1ib4u" path="res://scripts/components/out_of_screen_component.gd" id="4_lqg4f"]
[ext_resource type="Script" uid="uid://bvsgg8lu0a8m6" path="res://scripts/components/lifetime_component.gd" id="5_qsc5m"]
[ext_resource type="Script" uid="uid://873un8agkyja" path="res://scripts/components/launch_component.gd" id="6_6th6w"]
[ext_resource type="Script" uid="uid://cvcnfrr1udco5" path="res://scripts/components/straight_motion_component.gd" id="7_e0mqp"]
[sub_resource type="CircleShape2D" id="CircleShape2D_txsw8"]
radius = 4.0
@@ -29,13 +33,34 @@ scale = Vector2(0.4, 0.4)
script = ExtResource("2_ll0xw")
area2d = NodePath("..")
[node name="BulletComponent" type="Node2D" parent="." node_paths=PackedStringArray("root", "area2d", "visibility_notifier", "timer")]
script = ExtResource("3_keogl")
root = NodePath("..")
speed = 120.0
area2d = NodePath("..")
[node name="Timer" type="Timer" parent="."]
wait_time = 5.0
autostart = true
[node name="OutOfScreenComponent" type="Node" parent="." node_paths=PackedStringArray("visibility_notifier", "root")]
script = ExtResource("4_lqg4f")
visibility_notifier = NodePath("../VisibleOnScreenNotifier2D")
root = NodePath("..")
[node name="LifetimeComponent" type="Node" parent="." node_paths=PackedStringArray("root", "timer")]
script = ExtResource("5_qsc5m")
root = NodePath("..")
life_time = 10.0
timer = NodePath("../Timer")
[node name="Timer" type="Timer" parent="."]
autostart = true
[node name="LaunchComponent" type="Node2D" parent="." node_paths=PackedStringArray("root")]
script = ExtResource("6_6th6w")
root = NodePath("..")
speed = 120.0
metadata/_custom_type_script = "uid://873un8agkyja"
[node name="StraightMotionComponent" type="Node" parent="." node_paths=PackedStringArray("root", "launch_component")]
script = ExtResource("7_e0mqp")
root = NodePath("..")
launch_component = NodePath("../LaunchComponent")
[node name="BulletComponent" type="Node" parent="." node_paths=PackedStringArray("root", "area2d")]
script = ExtResource("3_keogl")
root = NodePath("..")
area2d = NodePath("..")
metadata/_custom_type_script = "uid://cdnwrn8v05qhi"

View File

@@ -1,10 +1,14 @@
[gd_scene load_steps=8 format=3 uid="uid://5surx230gfw3"]
[gd_scene load_steps=13 format=3 uid="uid://5surx230gfw3"]
[ext_resource type="Texture2D" uid="uid://djifxc5x0dyrw" path="res://sprites/ppc_tileset.png" id="1_rcgxf"]
[ext_resource type="Script" uid="uid://bh2vrkdbrtpin" path="res://scripts/components/bullet.gd" id="2_1i2y5"]
[ext_resource type="Script" uid="uid://dkmxhjtmu5xlb" path="res://scripts/components/damage_component.gd" id="3_y0uai"]
[ext_resource type="Script" uid="uid://beg4dk7d5pvhp" path="res://scripts/components/explosive_component.gd" id="4_8lw0n"]
[ext_resource type="PackedScene" uid="uid://dyp4i4ru2j2jh" path="res://objects/fxs/explosion_fx.tscn" id="5_6oopj"]
[ext_resource type="Script" uid="uid://1tnr46o1ib4u" path="res://scripts/components/out_of_screen_component.gd" id="6_5jrjx"]
[ext_resource type="Script" uid="uid://873un8agkyja" path="res://scripts/components/launch_component.gd" id="7_a2b5x"]
[ext_resource type="Script" uid="uid://bvsgg8lu0a8m6" path="res://scripts/components/lifetime_component.gd" id="7_nqeob"]
[ext_resource type="Script" uid="uid://c2gbumw4x4t1v" path="res://scripts/components/gravity_motion_component.gd" id="8_4ly8b"]
[ext_resource type="Script" uid="uid://ciowd622nk0i7" path="res://scripts/components/chargable_component.gd" id="9_a2b5x"]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_ar0xf"]
size = Vector2(16, 10)
@@ -12,9 +16,12 @@ size = Vector2(16, 10)
[sub_resource type="CircleShape2D" id="CircleShape2D_e6vaq"]
radius = 32.0
[node name="Brick" type="Area2D"]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_nqeob"]
size = Vector2(16, 10)
[node name="ExplosiveBrick" type="CharacterBody2D"]
collision_layer = 16
collision_mask = 9
collision_mask = 8
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
shape = SubResource("RectangleShape2D_ar0xf")
@@ -25,40 +32,63 @@ hframes = 12
vframes = 12
frame = 80
[node name="BulletComponent" type="Node" parent="." node_paths=PackedStringArray("root", "area2d", "visibility_notifier", "timer")]
script = ExtResource("2_1i2y5")
root = NodePath("..")
speed = 120.0
area2d = NodePath("..")
visibility_notifier = NodePath("../VisibleOnScreenNotifier2D")
life_time = 2.0
timer = NodePath("../Timer")
[node name="VisibleOnScreenNotifier2D" type="VisibleOnScreenNotifier2D" parent="."]
position = Vector2(0, 2.38419e-07)
scale = Vector2(0.8, 0.5)
[node name="Timer" type="Timer" parent="."]
[node name="DamageComponent" type="Node" parent="." node_paths=PackedStringArray("area2d")]
[node name="DamageComponent" type="Node" parent="." node_paths=PackedStringArray("area2d", "damage_timer")]
script = ExtResource("3_y0uai")
damage = 5.0
area2d = NodePath("..")
area2d = NodePath("../Explosion area")
damage_timer = NodePath("../Timer")
[node name="ExplosiveComponent" type="Node" parent="." node_paths=PackedStringArray("root", "damage", "area2d", "explosion_area2d")]
script = ExtResource("4_8lw0n")
root = NodePath("..")
damage = NodePath("../DamageComponent")
area2d = NodePath("..")
area2d = NodePath("../BulletArea")
explosion_area2d = NodePath("../Explosion area")
explosion_effect = ExtResource("5_6oopj")
[node name="Explosion area" type="Area2D" parent="."]
collision_layer = 0
collision_mask = 9
collision_mask = 8
[node name="CollisionShape2D" type="CollisionShape2D" parent="Explosion area"]
shape = SubResource("CircleShape2D_e6vaq")
debug_color = Color(0.919034, 6.36289e-05, 0.69998, 0.42)
[node name="ExplosionFX" parent="." instance=ExtResource("5_6oopj")]
randomness = 0.24
[node name="OutOfScreenComponent" type="Node" parent="." node_paths=PackedStringArray("visibility_notifier", "root")]
script = ExtResource("6_5jrjx")
visibility_notifier = NodePath("../VisibleOnScreenNotifier2D")
root = NodePath("..")
[node name="LifetimeComponent" type="Node" parent="." node_paths=PackedStringArray("root", "timer")]
script = ExtResource("7_nqeob")
root = NodePath("..")
timer = NodePath("../Timer")
[node name="LaunchComponent" type="Node2D" parent="." node_paths=PackedStringArray("root")]
script = ExtResource("7_a2b5x")
root = NodePath("..")
speed = 240.0
metadata/_custom_type_script = "uid://873un8agkyja"
[node name="GravityMotionComponent" type="Node2D" parent="." node_paths=PackedStringArray("character_body", "launch_component")]
script = ExtResource("8_4ly8b")
character_body = NodePath("..")
launch_component = NodePath("../LaunchComponent")
[node name="BulletArea" type="Area2D" parent="."]
collision_layer = 16
[node name="CollisionShape2D" type="CollisionShape2D" parent="BulletArea"]
shape = SubResource("RectangleShape2D_nqeob")
[node name="ChargableComponent" type="Node" parent="."]
script = ExtResource("9_a2b5x")

View File

@@ -1,10 +1,11 @@
[gd_scene load_steps=7 format=3 uid="uid://daau4j5hbklk0"]
[gd_scene load_steps=8 format=3 uid="uid://daau4j5hbklk0"]
[ext_resource type="Texture2D" uid="uid://djifxc5x0dyrw" path="res://sprites/ppc_tileset.png" id="1_52l28"]
[ext_resource type="Script" uid="uid://bh2vrkdbrtpin" path="res://scripts/components/bullet.gd" id="2_hjcob"]
[ext_resource type="Script" uid="uid://cdnwrn8v05qhi" path="res://scripts/components/bullet_component.gd" id="2_hjcob"]
[ext_resource type="Script" uid="uid://dkmxhjtmu5xlb" path="res://scripts/components/damage_component.gd" id="3_sog2h"]
[ext_resource type="Resource" uid="uid://obodgnkhxuhe" path="res://resources/status_effect/fire.tres" id="4_xx5l4"]
[ext_resource type="Script" uid="uid://d3brcje121krs" path="res://scripts/components/effect_inflictor_component.gd" id="5_ofrqk"]
[ext_resource type="Script" uid="uid://1tnr46o1ib4u" path="res://scripts/components/out_of_screen_component.gd" id="6_64yur"]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_ar0xf"]
size = Vector2(16, 10)
@@ -22,12 +23,11 @@ hframes = 12
vframes = 12
frame = 80
[node name="BulletComponent" type="Node" parent="." node_paths=PackedStringArray("root", "area2d", "visibility_notifier", "timer")]
[node name="BulletComponent" type="Node" parent="." node_paths=PackedStringArray("root", "area2d", "timer")]
script = ExtResource("2_hjcob")
root = NodePath("..")
speed = 330.0
area2d = NodePath("..")
visibility_notifier = NodePath("../VisibleOnScreenNotifier2D")
life_time = 2.0
timer = NodePath("../Timer")
@@ -46,3 +46,8 @@ status_effect_data = ExtResource("4_xx5l4")
[node name="EffectInflictorComponent" type="Node" parent="." node_paths=PackedStringArray("damage")]
script = ExtResource("5_ofrqk")
damage = NodePath("../DamageComponent")
[node name="OutOfScreenComponent" type="Node" parent="." node_paths=PackedStringArray("visibility_notifier", "root")]
script = ExtResource("6_64yur")
visibility_notifier = NodePath("../VisibleOnScreenNotifier2D")
root = NodePath("..")

View File

@@ -1,10 +1,11 @@
[gd_scene load_steps=7 format=3 uid="uid://bcmx07k12gcsc"]
[gd_scene load_steps=8 format=3 uid="uid://bcmx07k12gcsc"]
[ext_resource type="Texture2D" uid="uid://djifxc5x0dyrw" path="res://sprites/ppc_tileset.png" id="1_xusxl"]
[ext_resource type="Script" uid="uid://bh2vrkdbrtpin" path="res://scripts/components/bullet.gd" id="2_ilnf5"]
[ext_resource type="Script" uid="uid://cdnwrn8v05qhi" path="res://scripts/components/bullet_component.gd" id="2_ilnf5"]
[ext_resource type="Script" uid="uid://dkmxhjtmu5xlb" path="res://scripts/components/damage_component.gd" id="3_3yf4g"]
[ext_resource type="Resource" uid="uid://02l4nbnf2aft" path="res://resources/status_effect/ice.tres" id="4_da7hn"]
[ext_resource type="Script" uid="uid://d3brcje121krs" path="res://scripts/components/effect_inflictor_component.gd" id="5_x7vqb"]
[ext_resource type="Script" uid="uid://1tnr46o1ib4u" path="res://scripts/components/out_of_screen_component.gd" id="6_7tdxt"]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_ar0xf"]
size = Vector2(16, 10)
@@ -22,12 +23,11 @@ hframes = 12
vframes = 12
frame = 80
[node name="BulletComponent" type="Node" parent="." node_paths=PackedStringArray("root", "area2d", "visibility_notifier", "timer")]
[node name="BulletComponent" type="Node" parent="." node_paths=PackedStringArray("root", "area2d", "timer")]
script = ExtResource("2_ilnf5")
root = NodePath("..")
speed = 250.0
area2d = NodePath("..")
visibility_notifier = NodePath("../VisibleOnScreenNotifier2D")
life_time = 2.0
timer = NodePath("../Timer")
@@ -46,3 +46,8 @@ status_effect_data = ExtResource("4_da7hn")
[node name="EffectInflictorComponent" type="Node" parent="." node_paths=PackedStringArray("damage")]
script = ExtResource("5_x7vqb")
damage = NodePath("../DamageComponent")
[node name="OutOfScreenComponent" type="Node" parent="." node_paths=PackedStringArray("visibility_notifier", "root")]
script = ExtResource("6_7tdxt")
visibility_notifier = NodePath("../VisibleOnScreenNotifier2D")
root = NodePath("..")