Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Sprite2D
- extends Sprite2D
- func _ready():
- randomize()
- var tween = create_tween()
- tween.tween_property(self, "modulate:a", 0.0, 0.4).set_trans(Tween.TRANS_SINE).set_ease(Tween.EASE_OUT)
- tween.tween_interval(0.6)
- tween.tween_callback(tween_all_completed)
- func tween_all_completed():
- self.queue_free()
- #------------------------------------------
- #Script that calls the function start_rush_ghost()
- @onready var source: Sprite2D = $"location where the source Sprites"
- var sprite
- func start_rush_ghost():
- for i in 7:
- instance_rush_ghost()
- await get_tree().create_timer(0.02).timeout
- func instance_rush_ghost():
- var ghost: Sprite2D = rush_ghost.instantiate()
- get_tree().root.add_child(ghost)
- ghost.global_position = player.global_position #Self explanatory
- ghost.texture = source.texture
- ghost.scale = source.scale
- ghost.vframes = source.vframes
- ghost.hframes = source.hframes
- ghost.frame = source.frame
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement