Imagetable return nil

Hi, I am creating my first technical test with playdate and I have a problem with imagetable. My problem is that it keeps returning nil even though I am using the correct path.
My code is simply this:

local pd <const> = playdate
local gfx <const> = pd.graphics

local enemyImageURL <const> = "images/enemy"

class("Enemy").extends()

function Enemy:init()
    imagetable, error = gfx.imagetable.new(enemyImageURL)
    print(error)
end

The result of this is that imagetable is nil and the console shows me:

file images/enemy not found: No such file

I find it strange that it does not work with most of my pngs. I have tried with 5 different ones. I upload only one because being a new user I can't upload the others I have tried:

Can someone guide me on why it doesn't work? What am I doing wrong?

Thank you!

Hello, does your file name includes the -table-w-h appendix? for example enemy-table-32-32.png ?

That was exactly the problem! I knew it must be silly. I don't know how I missed that in the documentation.
Thank you so much!

2 Likes