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"]

View File

@@ -1,4 +1,4 @@
[gd_scene load_steps=9 format=3 uid="uid://bwdlmualj6xbw"]
[gd_scene load_steps=10 format=3 uid="uid://bwdlmualj6xbw"]
[ext_resource type="Texture2D" uid="uid://xes6mt2dd5gu" path="res://sprites/robot_cutout.png" id="1_uh38l"]
[ext_resource type="Script" path="res://scripts/components/health.gd" id="2_o170m"]
@@ -6,6 +6,7 @@
[ext_resource type="Script" path="res://scripts/components/side_to_side_movement.gd" id="4_gbsq8"]
[ext_resource type="Script" path="res://scripts/components/periodic_shooting.gd" id="5_m03v0"]
[ext_resource type="Script" path="res://scripts/components/enemy_death.gd" id="6_6p3gr"]
[ext_resource type="Script" path="res://scripts/components/flashing_component.gd" id="7_xsaiy"]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_pwwji"]
size = Vector2(18, 27)
@@ -65,3 +66,8 @@ position = Vector2(-16, 13)
[node name="Right Ray" type="RayCast2D" parent="."]
position = Vector2(16, 13)
[node name="FlashingComponent" type="Node" parent="." node_paths=PackedStringArray("sprite", "health_component")]
script = ExtResource("7_xsaiy")
sprite = NodePath("../Sprite2D")
health_component = NodePath("../HealthComponent")