Okay. Here is a sample of how the images are being loaded.
tileegine class:
[lua]
local tileengine = {}
tileengine.layerA = {}
tileengine.layerB = {}
tileengine.buildLayer = function (layerName, imageSheet, sequences, sequenceName)
local tileNumber = table tile number
local xP = table tile x
local yP = table tile y
table.insert(layerName, display.newSprite(imageSheet, sequences))
layerName[#layerName]:setSequence(sequenceName[tileNumber])
layerName[#layerName]:play()
layerName[#layerName].x = xP
layerName[#layerName].y = yP
end
return tileengine
[/lua]
tiledata class:
[lua]
local options = {width = 16, height = 16, numFrames = 16, border = 0, sheetContentWidth = 64, sheetContentHeight = 64}
local tiledata = {
sequenceNames = {“a”},
sequences = {{name=“a”, frames={1}, time=1000, loopCount=1}},
imageSheet = graphics.newImageSheet(“img/imageSheet.png”, options)
}
return tiledata
[/lua]
main class:
[lua]
local tileengine = require(“tileengine”)
local tiledata = require(“tiledata”)
local Main = {}
local buildLevel = {}
function Main()
buildLevel()
end
function buildLevel()
tileengine.buildLayer(tileengine.layerA, tiledata[“imageSheet”], tiledata[“sequences”], tiledata[“sequenceNames”])
tileengine.buildLayer(tileengine.layerB, tiledata[“imageSheet”], tiledata[“sequences”], tiledata[“sequenceNames”])
end
Main()
[/lua]