Just because it was so simple and fast to make...
Also, there's some initiation problems :\ or something. This doesn't work:
Code: Select all
map = {
img = love.graphics.newImage("gfx/image.png"),
tilesx = 5,
tilesy = 5,
}
for y = 1, map.tilesy do
for x = 1, map.tilesx do
map[y][x] = (x-1) + (y-1) * map.tilesy
end
end
Code: Select all
map = {
img = love.graphics.newImage("gfx/image.png"),
tilesx = 5,
tilesy = 5,
{0,1,2,3,4},
{5,6,7,8,9},
{10,11,12,13,14},
{15,16,17,18,19},
{20,21,22,23,24},
}
for y = 1, map.tilesy do
for x = 1, map.tilesx do
map[y][x] = (x-1) + (y-1) * map.tilesy
end
end