Co-authored-by: Ivan Yuriev <ivanyr44@gmail.com>
This commit is contained in:
Neckrat 2025-08-23 23:19:00 +03:00
parent 9a2398df8d
commit 125cf7fd6d
4 changed files with 7 additions and 5 deletions

View File

@ -17,7 +17,7 @@ end
function map:draw() function map:draw()
for y = 0, self.size.y - 1 do for y = 0, self.size.y - 1 do
for x = 0, self.size.x - 1 do for x = 0, self.size.x - 1 do
love.graphics.draw(self.atlas, self[x][y], x, y, love.graphics.draw(self.atlas, self[x][y].quad, x, y,
nil, 1 / 32, 1 / 32) nil, 1 / 32, 1 / 32)
end end
end end

View File

@ -10,7 +10,7 @@ local function new(template, size)
for y = 0, size.y - 1 do for y = 0, size.y - 1 do
map[y] = {} map[y] = {}
for x = 0, size.x - 1 do for x = 0, size.x - 1 do
local type = tileMap["flower_grass"] local type = tileMap.map["flower_grass"]
map[y][x] = type[math.random(1, #type)] map[y][x] = type[math.random(1, #type)]
end end
end end

View File

@ -15,7 +15,7 @@ local function new(x, y, tileSize, atlas, isClip)
return setmetatable({ return setmetatable({
isClip = isClip, isClip = isClip,
quad = quad quad = quad
}) }, tile)
end end
--- @param quad love.Quad --- @param quad love.Quad

View File

@ -14,7 +14,8 @@ local function load(path)
local tiles = { local tiles = {
tileSize = manifest.tileSize, tileSize = manifest.tileSize,
atlas = atlas atlas = atlas,
map = {}
} }
manifest.tileSize = nil manifest.tileSize = nil
@ -28,12 +29,13 @@ local function load(path)
end end
end end
end end
-- Как пропатчить KDE2 под любое устройство, используя любые технологии, например, через модульные тесты или инструменты автоматизации?
local cnt = 0 local cnt = 0
for y = 0, atlas:getHeight() - 1, tiles.tileSize do for y = 0, atlas:getHeight() - 1, tiles.tileSize do
for x = 0, atlas:getWidth() - 1, tiles.tileSize do for x = 0, atlas:getWidth() - 1, tiles.tileSize do
if layout[cnt] then if layout[cnt] then
for _, group in ipairs(layout[cnt]) do for _, group in ipairs(layout[cnt]) do
print(x, y, tiles.tileSize, atlas, false)
local tile = require('lib.level.tile').new(x, y, tiles.tileSize, atlas, false) local tile = require('lib.level.tile').new(x, y, tiles.tileSize, atlas, false)
if tiles.map[group] then if tiles.map[group] then
table.insert(tiles.map[group], tile) table.insert(tiles.map[group], tile)