Skip to content

Commit

Permalink
Fix bug related to once animations
Browse files Browse the repository at this point in the history
If we do not set `self.current_frame = 0;` when a `Once` animation has finished, then the animation is never able to be executed again.

With this update, the animation is able to be properly restarted next time the `Play` component is added to the corresponding entity.
  • Loading branch information
thedodd authored Jul 23, 2021
1 parent 34d6a83 commit 8304d0c
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ impl SpriteSheetAnimationState {
} else if matches!(animation.mode, AnimationMode::Repeat) {
self.current_frame = 0;
} else {
self.current_frame = 0;
return true;
}

Expand Down

0 comments on commit 8304d0c

Please sign in to comment.