File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed
engine/modules/entities/src/main/resources/view/entity-module Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -38,8 +38,13 @@ export class SpriteAnimation extends TextureBasedEntity {
3838 const images = state . images . split ( ',' )
3939
4040 if ( state . animationProgress >= 0 ) {
41- const animationIndex = Math . floor ( images . length * state . animationProgress )
41+ const currentDate = frame . date + frame . frameDuration * progress
42+ const extrapolatedState = { ...state , date : currentDate }
43+ this . computeAnimationProgressTime ( state , extrapolatedState )
44+
45+ const animationIndex = Math . floor ( images . length * extrapolatedState . animationProgress )
4246 const image = state . loop ? images [ animationIndex % images . length ] : ( images [ animationIndex ] || images [ images . length - 1 ] )
47+
4348 try {
4449 this . graphics . texture = PIXI . Texture . fromFrame ( image )
4550 } catch ( error ) {
Original file line number Diff line number Diff line change 22
33The CodinGame SDK is regularly updated and improved. This document lets you know what changed in the latest releases.
44
5- ## NEXT RELEASE
5+ ## Next Release
66
77### 🐞 Bug fix
88
99- Removed accidental console.log from app.js
10+ - Fixed ` SpriteAnimation ` that would sometimes not animate
1011
1112## 3.10.0
1213
You can’t perform that action at this time.
0 commit comments