Code: Select all
function draw_map()
for y = 1, map_display_h do
for x = 1, map_display_w do
love.graphics.draw(tile[map[y+map_y][x+map_x]],0,0)
--love.graphics.draw(tile[map[2][2]],0,0)
--love.graphics.draw(tile[level[y][x]], x*50, y*50)
--love.graphics.draw(tiles, x*50, y*50)
--love.graphics.draw(tile[map[y+map_y][x+map_x]],(x*tile_w)+map_offset_x,(y*tile_h)+map_offset_y)
end
end
end
Code: Select all
tile = {}
for i = 0, 2 do
tile[i] = love.graphics.newImage("tile" ..i.. ".png")
end
map_display_w = 25
map_display_h = 9
map_x = 0
map_y = 0
map={"0000000000000000000000000",
"0111111111111111111111110",
"0111111111111111111111110",
"0111111111111111111111110",
"0111111111111111111111110",
"0111111111111111111111110",
"0111111111211111211111110",
"0111211111111111211112110",
"0000000000000000000000000",
}