Add KnockbackComponent and HazardComponent for enhanced enemy interactions; integrate knockback effects in DamageComponent
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
[gd_scene load_steps=25 format=3 uid="uid://bockkmyn8il4c"]
|
||||
[gd_scene load_steps=26 format=3 uid="uid://bockkmyn8il4c"]
|
||||
|
||||
[ext_resource type="Shader" uid="uid://bs4xvm4qkurpr" path="res://shaders/hit_flash.tres" id="1_hh6y0"]
|
||||
[ext_resource type="Texture2D" uid="uid://duxx56wxmjoxd" path="res://sprites/basic_enemy.png" id="2_laaj3"]
|
||||
@@ -14,6 +14,7 @@
|
||||
[ext_resource type="AudioStream" uid="uid://b3tsqhr06pbrs" path="res://sfx/enemy_hurt.wav" id="14_ndloc"]
|
||||
[ext_resource type="AudioStream" uid="uid://dyev46uqusimi" path="res://sfx/shoot.wav" id="15_cg63s"]
|
||||
[ext_resource type="PackedScene" uid="uid://dx80ivlvuuew4" path="res://objects/fxs/fire_fx.tscn" id="16_jqaq6"]
|
||||
[ext_resource type="Script" uid="uid://cgfynrn68lp12" path="res://scripts/components/KnockbackComponent.cs" id="17_ih01d"]
|
||||
[ext_resource type="PackedScene" uid="uid://ck6nml06tm6ue" path="res://objects/fxs/ice_fx.tscn" id="17_o7qsb"]
|
||||
[ext_resource type="PackedScene" uid="uid://b12tppjkkqpt4" path="res://objects/fxs/hit_particles.tscn" id="18_v861c"]
|
||||
|
||||
@@ -172,3 +173,7 @@ visible = false
|
||||
[node name="HitParticles" parent="." instance=ExtResource("18_v861c")]
|
||||
position = Vector2(0, 1)
|
||||
process_material = SubResource("ParticleProcessMaterial_pxaaa")
|
||||
|
||||
[node name="KnockbackComponent" type="Node" parent="."]
|
||||
script = ExtResource("17_ih01d")
|
||||
metadata/_custom_type_script = "uid://cgfynrn68lp12"
|
||||
|
@@ -1,4 +1,4 @@
|
||||
[gd_scene load_steps=52 format=3 uid="uid://bqi5s710xb1ju"]
|
||||
[gd_scene load_steps=51 format=3 uid="uid://bqi5s710xb1ju"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://csel4s0e4g5uf" path="res://scripts/components/PlayerController.cs" id="1_yysbb"]
|
||||
[ext_resource type="Shader" uid="uid://bs4xvm4qkurpr" path="res://shaders/hit_flash.tres" id="2_lgb3u"]
|
||||
@@ -21,7 +21,6 @@
|
||||
[ext_resource type="Script" uid="uid://ccqb8kd5m0eh7" path="res://scripts/components/ScoreComponent.cs" id="11_o1ihh"]
|
||||
[ext_resource type="Script" uid="uid://dgb8bqcri7nsj" path="res://scripts/components/HealthComponent.cs" id="12_ur2y5"]
|
||||
[ext_resource type="Script" uid="uid://byw1legrv1ep2" path="res://scripts/components/PlayerDeathComponent.cs" id="13_7til7"]
|
||||
[ext_resource type="Script" uid="uid://cgfynrn68lp12" path="res://scripts/components/KnockbackComponent.cs" id="14_e5pae"]
|
||||
[ext_resource type="Script" uid="uid://cecelixl41t3j" path="res://scripts/components/InvulnerabilityComponent.cs" id="15_xuhvf"]
|
||||
[ext_resource type="Script" uid="uid://dvyd26ricriql" path="res://scripts/components/FlashingComponent.cs" id="16_uno3u"]
|
||||
[ext_resource type="Script" uid="uid://dtg6115je7b5s" path="res://scripts/components/StompDamageComponent.cs" id="17_bl1gx"]
|
||||
@@ -182,11 +181,6 @@ script = ExtResource("13_7til7")
|
||||
DeathSfx = NodePath("../sfx_hurt")
|
||||
HealthComponent = NodePath("../HealthComponent")
|
||||
|
||||
[node name="KnockbackComponent" type="Node" parent="." node_paths=PackedStringArray("HealthComponent")]
|
||||
script = ExtResource("14_e5pae")
|
||||
KnockbackForce = 1250.0
|
||||
HealthComponent = NodePath("../HealthComponent")
|
||||
|
||||
[node name="InvulnerabilityComponent" type="Node" parent="." node_paths=PackedStringArray("FlashingComponent")]
|
||||
script = ExtResource("15_xuhvf")
|
||||
FlashingComponent = NodePath("../FlashingComponent Base")
|
||||
|
41
objects/entities/cactus.tscn
Normal file
41
objects/entities/cactus.tscn
Normal file
@@ -0,0 +1,41 @@
|
||||
[gd_scene load_steps=6 format=3 uid="uid://un55bdc2cg2q"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://djifxc5x0dyrw" path="res://sprites/ppc_tileset.png" id="1_1nndd"]
|
||||
[ext_resource type="Script" uid="uid://cgfynrn68lp12" path="res://scripts/components/KnockbackComponent.cs" id="2_bljtt"]
|
||||
[ext_resource type="Script" uid="uid://nhu2xd8611fk" path="res://scripts/components/HazardComponent.cs" id="3_bljtt"]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_14ml2"]
|
||||
size = Vector2(14, 15)
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_4q8oh"]
|
||||
size = Vector2(16, 16)
|
||||
|
||||
[node name="Cactus" type="StaticBody2D"]
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||
position = Vector2(0, 0.5)
|
||||
shape = SubResource("RectangleShape2D_14ml2")
|
||||
|
||||
[node name="Sprite2D" type="Sprite2D" parent="."]
|
||||
texture = ExtResource("1_1nndd")
|
||||
hframes = 12
|
||||
vframes = 12
|
||||
frame = 71
|
||||
|
||||
[node name="Area2D" type="Area2D" parent="."]
|
||||
collision_mask = 12
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D"]
|
||||
position = Vector2(-0.5, 0)
|
||||
shape = SubResource("RectangleShape2D_4q8oh")
|
||||
debug_color = Color(0.285572, 0.422655, 0.118384, 0.42)
|
||||
|
||||
[node name="KnockbackComponent" type="Node" parent="."]
|
||||
script = ExtResource("2_bljtt")
|
||||
metadata/_custom_type_script = "uid://cgfynrn68lp12"
|
||||
|
||||
[node name="HazardComponent" type="Node2D" parent="." node_paths=PackedStringArray("KnockbackComponent", "HazardArea")]
|
||||
script = ExtResource("3_bljtt")
|
||||
KnockbackComponent = NodePath("../KnockbackComponent")
|
||||
HazardArea = NodePath("../Area2D")
|
||||
metadata/_custom_type_script = "uid://nhu2xd8611fk"
|
@@ -1,4 +1,4 @@
|
||||
[gd_scene load_steps=27 format=3 uid="uid://bwdlmualj6xbw"]
|
||||
[gd_scene load_steps=28 format=3 uid="uid://bwdlmualj6xbw"]
|
||||
|
||||
[ext_resource type="Shader" uid="uid://bs4xvm4qkurpr" path="res://shaders/hit_flash.tres" id="1_ep4yr"]
|
||||
[ext_resource type="Texture2D" uid="uid://cu72810eyk4dx" path="res://sprites/enemy-robot.png" id="2_hjtwe"]
|
||||
@@ -18,6 +18,7 @@
|
||||
[ext_resource type="PackedScene" uid="uid://dx80ivlvuuew4" path="res://objects/fxs/fire_fx.tscn" id="15_mc6rj"]
|
||||
[ext_resource type="PackedScene" uid="uid://ck6nml06tm6ue" path="res://objects/fxs/ice_fx.tscn" id="16_68hnm"]
|
||||
[ext_resource type="PackedScene" uid="uid://b12tppjkkqpt4" path="res://objects/fxs/hit_particles.tscn" id="18_pxaaa"]
|
||||
[ext_resource type="Script" uid="uid://cgfynrn68lp12" path="res://scripts/components/KnockbackComponent.cs" id="19_xku20"]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_pwwji"]
|
||||
size = Vector2(25, 31)
|
||||
@@ -182,3 +183,7 @@ visible = false
|
||||
[node name="HitParticles" parent="." instance=ExtResource("18_pxaaa")]
|
||||
position = Vector2(0, 1)
|
||||
process_material = SubResource("ParticleProcessMaterial_pxaaa")
|
||||
|
||||
[node name="KnockbackComponent" type="Node" parent="."]
|
||||
script = ExtResource("19_xku20")
|
||||
metadata/_custom_type_script = "uid://cgfynrn68lp12"
|
||||
|
Reference in New Issue
Block a user