Animated Sprite load error

Hi I am just learning lua and playdate development. I followed some tutorials to get started and wanted to use the Animated Sprite lib to help with Sprite animations.

I made a little sonic sprite sheet with 6 frames to cycle as states. Each frame is 64x64 the sheet is 384x64. For the life of me I cannot figure out why it wont load and I just get a nil error. I know its in the correct location as I can swap out that sprite for one from a tutorial and it works fine.

Error:
Load failed, error: scripts/libraries/AnimatedSprite.lua:30: Imagetable is nil. Check if it was loaded correctly.
stack traceback:
[C]: in function 'assert'
scripts/libraries/AnimatedSprite.lua:30: in field 'init'
scripts/player.lua:12: in field 'init'
CoreLibs/object.lua:70: in global 'Player'
scripts/gameScene.lua:22: in field 'init'
CoreLibs/object.lua:70: in global 'GameScene'
main.lua:13: in main chunk

    local playerImageTable = gfx.imagetable.new("images/hangglider-64-64")
    Player.super.init(self, playerImageTable)

hangglider-64-64

I'm sure its something silly here but I cannot find out what is wrong with my image. Others will load and any I create will not.

Any help is greatly appreciated.

Hello, make sure the file is named xxx-table-64-64, in this example it would be hangglider-table-64-64, then you can load it like this:

local playerImageTable = gfx.imagetable.new("images/hangglider")
Player.super.init(self, playerImageTable)
1 Like