Neckrat 125cf7fd6d fix tile
Co-authored-by: Ivan Yuriev <ivanyr44@gmail.com>
2025-08-23 23:19:00 +03:00

27 lines
634 B
Lua

--- @class Map
--- @field atlas love.Image
--- @field size Vec3|nil
local map = {}
map.__index = map
--- create new map
--- @param type "procedural"|"handmaded"
--- @param template Procedural|Handmaded
--- @param size? Vec3
local function new(type, template, size)
map.size = size
local tMap = require('lib.level.' .. type).new(template, size)
return setmetatable(tMap, map)
end
function map:draw()
for y = 0, self.size.y - 1 do
for x = 0, self.size.x - 1 do
love.graphics.draw(self.atlas, self[x][y].quad, x, y,
nil, 1 / 32, 1 / 32)
end
end
end
return { new = new }