After imagees
This commit is contained in:
parent
421220e763
commit
279b5e5599
8 changed files with 91 additions and 35 deletions
11
Particles/Player/AfterImage.tscn
Normal file
11
Particles/Player/AfterImage.tscn
Normal file
|
@ -0,0 +1,11 @@
|
|||
[gd_scene load_steps=2 format=3 uid="uid://bfd5g1y0u4e38"]
|
||||
|
||||
[ext_resource type="Script" path="res://Particles/Scripts/FadeAway.gd" id="1_jmv86"]
|
||||
|
||||
[node name="AfterImage" type="Sprite2D"]
|
||||
modulate = Color(1, 1, 1, 0.752941)
|
||||
show_behind_parent = true
|
||||
top_level = true
|
||||
visibility_layer = 257
|
||||
rotation = 0.0123838
|
||||
script = ExtResource("1_jmv86")
|
20
Particles/Scripts/FadeAway.gd
Normal file
20
Particles/Scripts/FadeAway.gd
Normal file
|
@ -0,0 +1,20 @@
|
|||
extends Sprite2D
|
||||
|
||||
@onready var parent = get_parent()
|
||||
|
||||
var duration = 0.25
|
||||
|
||||
func _ready():
|
||||
self_modulate = parent.self_modulate
|
||||
texture = parent.texture
|
||||
scale = parent.scale
|
||||
offset = parent.offset
|
||||
global_position = parent.global_position
|
||||
rotation = parent.rotation
|
||||
|
||||
var tween = create_tween()
|
||||
tween.tween_property(self, "modulate", Color8(255, 255, 255, 0), duration)
|
||||
|
||||
await get_tree().create_timer(duration).timeout
|
||||
|
||||
queue_free()
|
Loading…
Add table
Add a link
Reference in a new issue