Add explosion effect to explosive component and implement cleanup functionality
This commit is contained in:
@@ -1,9 +1,10 @@
|
||||
[gd_scene load_steps=7 format=3 uid="uid://5surx230gfw3"]
|
||||
[gd_scene load_steps=8 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" path="res://scripts/components/bullet.gd" id="2_1i2y5"]
|
||||
[ext_resource type="Script" path="res://scripts/components/damage_component.gd" id="3_y0uai"]
|
||||
[ext_resource type="Script" path="res://scripts/components/explosive_component.gd" id="4_8lw0n"]
|
||||
[ext_resource type="PackedScene" uid="uid://dyp4i4ru2j2jh" path="res://objects/explosion_fx.tscn" id="5_6oopj"]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_ar0xf"]
|
||||
size = Vector2(16, 10)
|
||||
@@ -50,6 +51,7 @@ root = NodePath("..")
|
||||
damage = NodePath("../DamageComponent")
|
||||
area2d = NodePath("..")
|
||||
explosion_area2d = NodePath("../Explosion area")
|
||||
explosion_effect = ExtResource("5_6oopj")
|
||||
|
||||
[node name="Explosion area" type="Area2D" parent="."]
|
||||
collision_layer = 0
|
||||
@@ -57,3 +59,6 @@ collision_mask = 9
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="Explosion area"]
|
||||
shape = SubResource("CircleShape2D_e6vaq")
|
||||
|
||||
[node name="ExplosionFX" parent="." instance=ExtResource("5_6oopj")]
|
||||
randomness = 0.24
|
||||
|
52
objects/explosion_fx.tscn
Normal file
52
objects/explosion_fx.tscn
Normal file
@@ -0,0 +1,52 @@
|
||||
[gd_scene load_steps=9 format=3 uid="uid://dyp4i4ru2j2jh"]
|
||||
|
||||
[ext_resource type="Script" path="res://scripts/components/cleanup_component.gd" id="1_8uvxg"]
|
||||
|
||||
[sub_resource type="Curve" id="Curve_8umf8"]
|
||||
_data = [Vector2(0, 1), 0.0, 0.0, 0, 0, Vector2(1, 0.4), 0.0, 0.0, 0, 0]
|
||||
point_count = 2
|
||||
|
||||
[sub_resource type="CurveTexture" id="CurveTexture_w18ti"]
|
||||
curve = SubResource("Curve_8umf8")
|
||||
|
||||
[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, 0.501961)
|
||||
|
||||
[sub_resource type="GradientTexture1D" id="GradientTexture1D_f0o3s"]
|
||||
gradient = SubResource("Gradient_5woy1")
|
||||
|
||||
[sub_resource type="Curve" id="Curve_0bqc3"]
|
||||
_data = [Vector2(0, 1), 0.0, 0.0, 0, 0, Vector2(1, 0.1), 0.0, 0.0, 0, 0]
|
||||
point_count = 2
|
||||
|
||||
[sub_resource type="CurveTexture" id="CurveTexture_w0m05"]
|
||||
curve = SubResource("Curve_0bqc3")
|
||||
|
||||
[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_1ujje"]
|
||||
particle_flag_disable_z = true
|
||||
emission_shape_scale = Vector3(0.5, 0.5, 0.5)
|
||||
spread = 180.0
|
||||
initial_velocity_min = 32.0
|
||||
initial_velocity_max = 32.0
|
||||
angular_velocity_min = 41.62
|
||||
angular_velocity_max = 41.62
|
||||
gravity = Vector3(0, 0, 0)
|
||||
scale_curve = SubResource("CurveTexture_w0m05")
|
||||
color_ramp = SubResource("GradientTexture1D_f0o3s")
|
||||
alpha_curve = SubResource("CurveTexture_w18ti")
|
||||
|
||||
[node name="ExplosionFX" type="GPUParticles2D"]
|
||||
emitting = false
|
||||
amount = 2048
|
||||
process_material = SubResource("ParticleProcessMaterial_1ujje")
|
||||
lifetime = 0.5
|
||||
one_shot = true
|
||||
explosiveness = 1.0
|
||||
fixed_fps = 24
|
||||
|
||||
[node name="CleanUpComponent" type="Node" parent="." node_paths=PackedStringArray("root")]
|
||||
script = ExtResource("1_8uvxg")
|
||||
root = NodePath("..")
|
||||
|
||||
[connection signal="finished" from="." to="CleanUpComponent" method="clean_up"]
|
@@ -2,7 +2,7 @@
|
||||
|
||||
[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)
|
||||
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, 0.501961)
|
||||
|
||||
[sub_resource type="GradientTexture1D" id="GradientTexture1D_mar4t"]
|
||||
gradient = SubResource("Gradient_5woy1")
|
||||
|
Reference in New Issue
Block a user