Skip to content

Commit

Permalink
fix: Die behavior with animation #315 (#333)
Browse files Browse the repository at this point in the history
  • Loading branch information
qlli committed Sep 14, 2024
1 parent e8d7bc1 commit 5e8dc87
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions sprite.go
Original file line number Diff line number Diff line change
Expand Up @@ -488,6 +488,8 @@ func (p *Sprite) OnTurning__1(onTurning func()) {
func (p *Sprite) Die() {
aniName := p.getStateAnimName(StateDie)
p.SetDying()

p.Stop(OtherScriptsInSprite)
if ani, ok := p.animations[aniName]; ok {
p.goAnimate(aniName, ani)
}
Expand Down

0 comments on commit 5e8dc87

Please sign in to comment.