From e597f8da20fc4e337bce9c5812f96421085430e0 Mon Sep 17 00:00:00 2001 From: PeaAshMeter Date: Mon, 13 Apr 2026 03:31:49 +0300 Subject: [PATCH] randomize first frame of idle animation --- lib/character/behaviors/sprite.lua | 3 +++ 1 file changed, 3 insertions(+) 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