hi,
Now, i use this type of grid to make my level :
local gridGame = {} local row = 9 local cell = 14 local rectx = 30 local recty = 30 local gridscaley = 0.35 local gridscalex = 0.35 local space = 2 local spaceleft =40 local spacetop = 20 for i = 1, cell do gridGame[i] = {}; for k = 1, row do gridGame[i][k] = display.newImage("dalle.png") gridGame[i][k].yScale=0.35 gridGame[i][k].xScale=0.35 gridGame[i][k].alpha = 1 gridGame[i][k].x = (k - 1) \* (rectx + space) + spaceleft gridGame[i][k].y = (i - 1) \* (recty + space) + spacetop end end
but in the future i would more personnalize and make this
mytable = {} 0 0 1 0 1 0 1 0 0 1 0 1 end
where each number represent a cell
**0 for a red cell
1 for a green cell**
but my question is how to have a space between each cell with this type of representation ?
with the previous grid, it’s make with
gridGame[i][k].x = (k - 1) \* (rectx + space) + spaceleft gridGame[i][k].y = (i - 1) \* (recty + space) + spacetop
But i don’t know how to make this with this new table ?
thanks