...
 
Commits (2)
File added
extends Node2D
func _ready():
$Particles.emitting = true
yield(get_tree().create_timer(1.5), "timeout")
queue_free()
[gd_scene load_steps=4 format=2]
[ext_resource path="res://gfx/SmokeFX.gd" type="Script" id=1]
[ext_resource path="res://gfx/smoke.png" type="Texture" id=2]
[sub_resource type="Gradient" id=1]
offsets = PoolRealArray( 0, 0.128319, 0.721239, 1 )
colors = PoolColorArray( 0, 0, 0, 0.654902, 0.039823, 0.039823, 0.039823, 1, 0.721569, 0.721569, 0.721569, 0.627451, 1, 1, 1, 0 )
[node name="SmokeFX" type="Node2D"]
script = ExtResource( 1 )
[node name="Particles" type="CPUParticles2D" parent="."]
emitting = false
amount = 12
lifetime = 0.6
one_shot = true
explosiveness = 0.38
texture = ExtResource( 2 )
gravity = Vector2( 0, 0 )
initial_velocity = 26.68
initial_velocity_random = 0.09
angular_velocity = 21.08
angular_velocity_random = 0.33
color_ramp = SubResource( 1 )
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/smoke.png-866d9f6da6eead388f7ab251adeef251.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://gfx/smoke.png"
dest_files=[ "res://.import/smoke.png-866d9f6da6eead388f7ab251adeef251.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
......@@ -21,7 +21,9 @@ func fix(amount: float) -> void:
condition = min(condition, 1.0)
onready var SmokeFX := preload("res://gfx/SmokeFX.tscn")
func suddenBreak() -> void:
SoundManager.breaking()
condition -= rand_range(0.3, 1.0)
condition = max(condition, 0.0)
add_child(SmokeFX.instance())
......@@ -51,7 +51,9 @@ func createTool() -> void:
self_modulate = Color(1.0, 1.0, 1.0, 1.0)
onready var SmokeFX := preload("res://gfx/SmokeFX.tscn")
func destroyTool() -> void:
Globals.showToast("Your %s has broken!" % _tool.toolName)
Globals.player.add_child(SmokeFX.instance())
_tool = null
self_modulate = Color(1.0, 1.0, 1.0, 0.25)