Skip to content

Commit

Permalink
fix: Die behavior with animation #315
Browse files Browse the repository at this point in the history
  • Loading branch information
qlli committed Sep 10, 2024
1 parent cc23ad2 commit d3710b5
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 d3710b5

Please sign in to comment.