https://love2d.org/wiki/Tutorial:Isometric_Graphics
When i enter it into the lua file i get this:
Code: Select all
function love.load()
block_width = grass:getWidth()
block_height = grass:getHeight()
block_depth = block_height / 2
grid_size = 20
grid = {}
for x = 1,grid_size do
grid[x] = {}
for y = 1,grid_size do
grid[x][y] = 1
end
end
grid[2][4] = 2
grid[6][5] = 2
for x = 1,grid_size do
for y = 1,grid_size do
if grid[x][y] == 1 then
love.graphics.draw(grass,
grid_x + ((y-x) * (block_width / 2)),
grid_y + ((x+y) * (block_depth / 2)) - (block_depth * (grid_size / 2)))
else -- grid[x][y] == 2
love.graphics.draw(dirt,
grid_x + ((y-x) * (block_width / 2)),
grid_y + ((x+y) * (block_depth / 2)) - (block_depth * (grid_size / 2)))
end
end
end
end
So what code am i missing?