@@ -9,6 +9,8 @@ signal impact
const MAX_LIFE := 1999
+const Explosion = preload("res://effect/particle/explosion/Explosion.tscn")
+const EXPLOSION_OFFSET := Vector2(10, 5)
var life: int
@@ -33,6 +35,9 @@ func damage() -> void:
func blow_up() -> void:
emit_signal("kace_broken")
+ var explosion = Explosion.instance()
+ explosion.position = position + EXPLOSION_OFFSET
+ get_parent().add_child(explosion)
queue_free()
@@ -27,6 +27,7 @@ texture = ExtResource( 1 )
centered = false
[node name="ImpactSplash" parent="MainColor" instance=ExtResource( 6 )]
+emitting = false
[node name="Shape" type="CollisionShape2D" parent="."]
position = Vector2( 20, 10 )
@@ -0,0 +1,11 @@
+class_name Explosion
+extends Particles2D
+
+func _init():
+ emitting = true
+func _process(delta):
+ if not emitting:
+ queue_free()
@@ -0,0 +1,14 @@
+[gd_scene load_steps=4 format=2]
+[ext_resource path="res://effect/particle/explosion/brick_particle.png" type="Texture" id=1]
+[ext_resource path="res://effect/particle/explosion/Explosion.gd" type="Script" id=2]
+[ext_resource path="res://effect/particle/explosion/explosion_material.tres" type="Material" id=3]
+[node name="ExplosionSplash" type="Particles2D"]
+amount = 14
+one_shot = true
+explosiveness = 1.0
+process_material = ExtResource( 3 )
+texture = ExtResource( 1 )
+script = ExtResource( 2 )
@@ -0,0 +1,34 @@
+[remap]
+importer="texture"
+type="StreamTexture"
+path="res://.import/brick_particle.png-1e53dd15cab208b05f6c421426d647df.stex"
+metadata={
+"vram_texture": false
+}
+[deps]
+source_file="res://effect/particle/explosion/brick_particle.png"
+dest_files=[ "res://.import/brick_particle.png-1e53dd15cab208b05f6c421426d647df.stex" ]
+[params]
+compress/mode=0
+compress/lossy_quality=0.7
+compress/hdr_mode=0
+compress/bptc_ldr=0
+compress/normal_map=0
+flags/repeat=0
+flags/filter=true
+flags/mipmaps=false
+flags/anisotropic=false
+flags/srgb=2
+process/fix_alpha_border=true
+process/premult_alpha=false
+process/HDR_as_SRGB=false
+process/invert_color=false
+stream=false
+size_limit=0
+detect_3d=true
+svg/scale=1.0
@@ -0,0 +1,4 @@
+[gd_resource type="Curve" format=2]
+[resource]
+_data = [ Vector2( 0, 1.00227 ), 0.0, -1.8414, 0, 0, Vector2( 1, 0 ), 0.264356, 0.0, 0, 0 ]
@@ -0,0 +1,20 @@
+[gd_resource type="ParticlesMaterial" load_steps=3 format=2]
+[ext_resource path="res://effect/particle/explosion/explosion_curve.tres" type="Curve" id=1]
+[sub_resource type="CurveTexture" id=1]
+curve = ExtResource( 1 )
+emission_shape = 2
+emission_box_extents = Vector3( 10, 5, 0 )
+flag_disable_z = true
+spread = 180.0
+gravity = Vector3( 0, 0, 0 )
+initial_velocity = 200.0
+orbit_velocity = 0.0
+orbit_velocity_random = 0.0
+damping = 200.0
+scale_curve = SubResource( 1 )
+hue_variation = -0.19
+hue_variation_random = 0.55
@@ -44,6 +44,11 @@ _global_script_classes=[ {
"language": "GDScript",
"path": "res://component/entity/death/DeadLine.gd"
}, {
+"base": "Particles2D",
+"class": "Explosion",
+"language": "GDScript",
+"path": "res://effect/particle/explosion/Explosion.gd"
+}, {
"base": "Node2D",
"class": "Grid",
@@ -87,6 +92,7 @@ _global_script_class_icons={
"Catcher": "",
"ColorUtil": "",
"DeadLine": "",
+"Explosion": "",
"Grid": "",
"ImpactSplash": "",
"Launcher": "",