Code: Select all
for i = 1,#world do
for j = 1,#world do
tile = world[i][j]
if tile == '0' then
love.graphics.draw(grass,(i-1)*32-((j-1))*32,((j-1)*32+(i-1)*32)/2)
elseif tile == '1' then
love.graphics.draw(rocks,(i-1)*32-(j-1)*32,((j-1)*32+(i-1)*32)/2)
end
end
end
Code: Select all
x, y = cam:mousepos()
coordX = math.floor((x-y)/32)
coordY = math.floor((x+y)/64)