Skip to content

Commit

Permalink
fix:star wrath has leave animation
Browse files Browse the repository at this point in the history
  • Loading branch information
limuy2022 committed Jul 12, 2024
1 parent 0035a97 commit f4b4704
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
15 changes: 13 additions & 2 deletions scenes/weapons/star_wrath/star_wrath.gd
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
extends StarWrath

@export var star_wrath_origin: PackedScene
var operations = [func(): self.fall_star_process()]
@onready var animation_player = $AnimationPlayer
@onready var star_wrath = $StarWrath

var operations = [func(): self.fall_star_process(), func(): self.leave()]
var operation_idx = 0


func next_operation():
if operation_idx >= operations.size():
$"..".attack_finished.emit()
return
operations[operation_idx].call()
var tmp = operation_idx
operation_idx += 1
operations[tmp].call()


func fall_star_process():
Expand All @@ -20,5 +24,12 @@ func fall_star_process():
next_operation()


func leave():
await self.get_tree().create_timer(0.3).timeout
var tween = create_tween()
tween.tween_property(star_wrath, "global_position", Vector2(-100.0, -100), 2)
next_operation()


func laser():
pass
1 change: 1 addition & 0 deletions scenes/weapons/star_wrath/star_wrath.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ script = ExtResource("3_u5scp")
star_wrath_origin = ExtResource("4_eglqk")

[node name="StarWrath" type="Sprite2D" parent="StarWrath"]
position = Vector2(-100, -60)
scale = Vector2(2.97559, 2.97559)
texture = ExtResource("4_ohxcu")

Expand Down

0 comments on commit f4b4704

Please sign in to comment.