macOS SDK 2.0.1
I am trying to upgrade my player to a table so I can animate a walk cycle the file is called
player-R-table-192-32.png
this is the code I am editing but I am still confused as to how to do this and at the moment my assert fails
function Player:updateImage(direction)
-- local playerImage = gfx.image.new("images/sprites/player/player-" .. self.direction)
-- self:setImage(playerImage)
local playerTable = gfx.imagetable.new("images/sprites/player/player-" .. self.direction)
assert(self.playerTable)
self.playerImage = gfx.tilemap.new()
self.playerImage:setImageTable(self.playerTable)
self.playerTable:setSize(32, 32)
self.playerSprite = gfx.sprite.new()
self.playerSprite:setTilemap(self.playerImage)
self.playerSprite:add()
end