🤑 Indie game store🙌 Free games😂 Fun games😨 Horror games
👷 Game development🎨 Assets📚 Comics
🎉 Sales🎁 Bundles
(Edited 1 time)

finally, i fixed the problem with the animation! apparently, the problem was because of that line of code:

local spriteData = anim.frames[frame]
if(spriteData ~= nil) then
   apiBridge:DrawSprites(spriteData.spriteIDs, 20, 70, spriteData.width, false, false, true, 0)
end

but actually, i should have used this way:

local spriteData = anim.frames[anim.frame]
if(spriteData ~= nil) then
   apiBridge:DrawSprites(spriteData.spriteIDs, 20, 70, spriteData.width, false, false, true, 0)
end

no wonder why i haven't though of adding that kind of information...

alright! now, here the result i managed to get so far:


ok, now it's time to figure out how to give each frame a precise timing, let me explain: for example, the first frame will stay for let said 10 seconds the rest of frames will have different time to give some dynamism. for now, i have though of this code:

-- animation data

local anim = {
   delay = 0,
   frame = 1,
   time = 5,0.1,0.16,0.4,0.8,0.1,0.1,0.8,
   total = 8,
   frames=
      {player_idle_big11,player_idle_big12,player_idle_big13,player_idle_big14,player_idle_big15,player_idle_big16,player_idle_big17,player_idle_big18},
      {player_idle_big21,player_idle_big22,player_idle_big23,player_idle_big24,player_idle_big25,player_idle_big26,player_idle_big27,player_idle_big28},
      {player_idle_big11,player_flick_big1},
      {player_idle_big21,player_flick_big2},
      {player_alt_idle_big11,player_alt_idle_big12,player_alt_idle_big13,player_alt_idle_big14,player_alt_idle_big15,player_alt_idle_big16,player_alt_idle_big17,player_alt_idle_big18},
      {player_alt_idle_big21,player_alt_idle_big22,player_alt_idle_big23,player_alt_idle_big24,player_alt_idle_big25,player_alt_idle_big26,player_alt_idle_big27,player_alt_idle_big28}
}

and apparently, it didn't worked like i hoped.

also, you might noticed that i switched "player" to "anim" because i found out that these animation loop is much adapted for "anim" rather than "player. i will add the randomizer for the idle, the flick, and the alternate idle for later. and once all of them is done, i will try to add the input on the character.