randomize first frame of idle animation
This commit is contained in:
parent
4761446e73
commit
e597f8da20
@ -93,6 +93,9 @@ function sprite:loop(state)
|
|||||||
return print("[SpriteBehavior]: no animation for '" .. state .. "'")
|
return print("[SpriteBehavior]: no animation for '" .. state .. "'")
|
||||||
end
|
end
|
||||||
self.animationTable[state] = anim8.newAnimation(self.animationGrid[state], self.ANIMATION_SPEED)
|
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
|
self.state = state
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user