tilemap = {{1,1,1,1,1},
{1,0,0,0,0},
{1,1,1,1,1},
{1,0,0,0,0},
}
for i=1,5 do
for j=1,4 do
if tilemap[i][j]== 1 or nil then
local tile = display.newImageRect( tiles,1,32,32)
tile.x = 32*i-32+128
tile.y = 32*j-16+128
return nil
end
end
end