Hello…
I just found a program called “Tiles”
I create a map. exported the map for corona SDK.
I have a .lua file open in my Editor.
I see a table
return {
– here there are a lot of tables with info
– terrain, layers, size of tiles and so on
}
there is one table called “data” similar to this
data = { 24, 24, 23, 11, 19, 19, 12, 23, 24, 24, 23, 7, 2, 2, 1, 4, 2, 2, 3, 4, 4, 1, 3, 4, 1, 4, 2, 3, 2, 1, 4, 2, 2, 1, 2, 2, 2, 4, 3, 3, 2, 3, 3, 2, 3, 2, 4, 1, 3, 1, 1, 1, 1, 4, 1, 3, 3, 2, 1, 4, 2, 1, 3, 1, 3, 3, 4, 3, 4, 2, 1, 2, 3, 1, 1 }
I think this is the order of each tile to form the actual map.
QUESTION 1
How do I do that in Corona SDK?
when I have a … for i loop … to lay all the tiles
local tiles = {} function createBoard1() for i = 1, 20 do for j = 1, 20 do local aTile = display.newImageRect(sceneGroup, "images/grass1.png", 128, 64 ) tiles[i] = aTile -- For efficient instead of multiple lookups. aTile:setMask( maskGrass1 ) floorGroup:insert( aTile ) aTile.isHitTestMasked = true aTile.x = 128\*(i-1) aTile.y = 64\*(j-1) aTile.myID = (i-1) \* 20 + j aTile.touch = onTouch aTile:addEventListener( "touch" ) end end end createBoard1()
because it just gives me 1 image
local aTile = display.newImageRect(sceneGroup, “images/grass1.png”, 128, 64 )
but I would like to put many different tiles to form the map
QUESTION 1
Or if you are familiar with “Tiles” program
How do I use that “return” table in composer?
Thanks for all your help