diff --git a/lib/character/behaviors/sprite.lua b/lib/character/behaviors/sprite.lua index bfebe0b..0325a4b 100644 --- a/lib/character/behaviors/sprite.lua +++ b/lib/character/behaviors/sprite.lua @@ -93,6 +93,9 @@ function sprite:loop(state) return print("[SpriteBehavior]: no animation for '" .. state .. "'") end self.animationTable[state] = anim8.newAnimation(self.animationGrid[state], self.ANIMATION_SPEED) + if state == 'idle' then + self.animationTable[state]:gotoFrame(love.math.random(#self.animationTable[state].frames)) + end self.state = state end