Flashing component

This commit is contained in:
2025-02-09 06:22:54 +01:00
parent 0e1c9478fc
commit 867dde03c7
3 changed files with 84 additions and 4 deletions

View File

@@ -1,4 +1,4 @@
[gd_scene load_steps=15 format=3 uid="uid://bqi5s710xb1ju"]
[gd_scene load_steps=16 format=3 uid="uid://bqi5s710xb1ju"]
[ext_resource type="Script" path="res://scripts/player.gd" id="1_8j4h4"]
[ext_resource type="Texture2D" uid="uid://b7gp0gqvkv8j4" path="res://sprites/MrBrick_base.png" id="2_bc55y"]
@@ -11,7 +11,8 @@
[ext_resource type="Script" path="res://scripts/components/knockback.gd" id="9_rjyu4"]
[ext_resource type="Script" path="res://scripts/components/brick_throw.gd" id="10_u0v3b"]
[ext_resource type="PackedScene" uid="uid://bymro4t7angv5" path="res://objects/brick.tscn" id="11_qutq2"]
[ext_resource type="Script" path="res://scripts/components/StompDamageComponent.gd" id="12_0nvxt"]
[ext_resource type="Script" path="res://scripts/components/stomp_damage_component.gd" id="12_payr4"]
[ext_resource type="Script" path="res://scripts/components/flashing_component.gd" id="13_hrtyn"]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_hdsg1"]
size = Vector2(16, 31)
@@ -86,10 +87,28 @@ timer = NodePath("../ThrowTimer")
[node name="ThrowTimer" type="Timer" parent="."]
[node name="StompDamageComponent" type="Node" parent="." node_paths=PackedStringArray("area2d", "root")]
script = ExtResource("12_0nvxt")
script = ExtResource("12_payr4")
damage = 4.0
area2d = NodePath("../StompDamageArea")
root = NodePath("..")
[node name="FlashingComponent Base" type="Node" parent="." node_paths=PackedStringArray("sprite", "health_component")]
script = ExtResource("13_hrtyn")
sprite = NodePath("../Root/Base")
flash_duration = 1.0
health_component = NodePath("../HealthComponent")
[node name="FlashingComponent LEye" type="Node" parent="." node_paths=PackedStringArray("sprite", "health_component")]
script = ExtResource("13_hrtyn")
sprite = NodePath("../Root/Left Eye")
flash_duration = 1.0
health_component = NodePath("../HealthComponent")
[node name="FlashingComponent REye" type="Node" parent="." node_paths=PackedStringArray("sprite", "health_component")]
script = ExtResource("13_hrtyn")
sprite = NodePath("../Root/Right Eye")
flash_duration = 1.0
health_component = NodePath("../HealthComponent")
[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"]