Add fire effect component to enemies and update game manager with initial coin count

This commit is contained in:
2025-05-01 18:04:26 +02:00
parent 1a6e3dea78
commit d6bdcb151b
4 changed files with 48 additions and 3 deletions

View File

@@ -1,4 +1,4 @@
[gd_scene load_steps=18 format=3 uid="uid://bwdlmualj6xbw"]
[gd_scene load_steps=19 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"]
@@ -14,6 +14,7 @@
[ext_resource type="Script" path="res://scripts/components/ice_effect_component.gd" id="11_pq0k7"]
[ext_resource type="AudioStream" uid="uid://b3tsqhr06pbrs" path="res://sfx/enemy_hurt.wav" id="13_u4k3d"]
[ext_resource type="AudioStream" uid="uid://dyev46uqusimi" path="res://sfx/shoot.wav" id="14_tdjks"]
[ext_resource type="PackedScene" uid="uid://dx80ivlvuuew4" path="res://objects/fire_fx.tscn" id="15_mc6rj"]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_pwwji"]
size = Vector2(25, 31)
@@ -115,11 +116,12 @@ health_component = NodePath("../HealthComponent")
[node name="StatusEffectComponent" type="Node" parent="."]
script = ExtResource("10_5i27q")
[node name="FireEffectComponent" type="Node" parent="." node_paths=PackedStringArray("health_component", "status_effect_component", "root")]
[node name="FireEffectComponent" type="Node" parent="." node_paths=PackedStringArray("health_component", "status_effect_component", "root", "fire_fx")]
script = ExtResource("10_ej8vg")
health_component = NodePath("../HealthComponent")
status_effect_component = NodePath("../StatusEffectComponent")
root = NodePath("..")
fire_fx = NodePath("../FireFX")
[node name="IceEffectComponent" type="Node" parent="." node_paths=PackedStringArray("status_effect_component")]
script = ExtResource("11_pq0k7")
@@ -131,3 +133,8 @@ stream = ExtResource("13_u4k3d")
[node name="sfx_shoot" type="AudioStreamPlayer2D" parent="."]
stream = ExtResource("14_tdjks")
[node name="FireFX" parent="." instance=ExtResource("15_mc6rj")]
position = Vector2(0, 9)
emitting = false
amount = 2048

33
objects/fire_fx.tscn Normal file
View File

@@ -0,0 +1,33 @@
[gd_scene load_steps=6 format=3 uid="uid://dx80ivlvuuew4"]
[sub_resource type="Gradient" id="Gradient_5woy1"]
offsets = PackedFloat32Array(0, 0.173759, 0.521277, 0.687943, 0.886525, 1)
colors = PackedColorArray(0.635294, 0.188235, 0, 1, 0.890196, 0.317647, 0, 1, 1, 0.470588, 0.188235, 1, 1, 0.635294, 0, 1, 1, 0.858824, 0.635294, 1, 1, 1, 1, 1)
[sub_resource type="GradientTexture1D" id="GradientTexture1D_mar4t"]
gradient = SubResource("Gradient_5woy1")
[sub_resource type="Curve" id="Curve_xeno3"]
_data = [Vector2(0, 1), 0.0, 0.0, 0, 0, Vector2(1, 0.5), 0.0, 0.0, 0, 0]
point_count = 2
[sub_resource type="CurveTexture" id="CurveTexture_igm87"]
curve = SubResource("Curve_xeno3")
[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_dq33o"]
lifetime_randomness = 0.25
particle_flag_disable_z = true
emission_shape = 1
emission_sphere_radius = 8.0
angle_min = -70.0
angle_max = -40.0
spread = 0.0
gravity = Vector3(0, -100, 0)
scale_curve = SubResource("CurveTexture_igm87")
color_ramp = SubResource("GradientTexture1D_mar4t")
[node name="FireFX" type="GPUParticles2D"]
amount = 512
process_material = SubResource("ParticleProcessMaterial_dq33o")
lifetime = 0.5
fixed_fps = 24