mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-03-22 10:55:19 -04:00
Fixed sprites often disappearing when idle.
This commit is contained in:
parent
d4b1849eaf
commit
10314b8bfa
1 changed files with 3 additions and 0 deletions
|
@ -182,6 +182,7 @@ module.exports = class SegmentedSprite extends createjs.SpriteContainer
|
|||
|
||||
tick: (delta) ->
|
||||
return if @paused or not @baseMovieClip
|
||||
return @paused = true if @animLength is 1
|
||||
newFrame = @currentFrame + @framerate * delta / 1000
|
||||
|
||||
if newFrame > @animLength
|
||||
|
@ -195,6 +196,8 @@ module.exports = class SegmentedSprite extends createjs.SpriteContainer
|
|||
else
|
||||
newFrame = newFrame % @animLength
|
||||
|
||||
return if @currentFrame is newFrame
|
||||
|
||||
if @frames
|
||||
prevFrame = Math.floor(newFrame)
|
||||
nextFrame = Math.ceil(newFrame)
|
||||
|
|
Loading…
Reference in a new issue