TILE GENERATOR IS DEPRECATED BY CHATGPT ITS IVER OVER

This commit is contained in:
Neckrat 2025-08-15 02:15:14 +03:00
parent 827a5dc23c
commit b9707edd93
4 changed files with 87 additions and 20 deletions

View File

@ -0,0 +1,20 @@
return {
tileSize = 32,
["flower_grass"] = { 4, 5, 6, 7, 12, 13, 14, 15, 20, 21, 22, 23, 28, 29, 30, 31 },
["grass"] = { 0, 1, 2, 3, 8, 9, 10, 11, 16, 17, 18, 19, 24, 25, 26, 27 },
["grass_ne"] = { 63 },
["grass_nw"] = { 62 },
["road"] = { 32, 33, 40, 41, 48, 49 },
["road_down"] = { 36, 37, 38, 39 },
["road_left"] = { 35, 43, 51, 59 },
["road_only_ne"] = { 53, 58 },
["road_only_nw"] = { 52 },
["road_only_se"] = { 55 },
["road_only_sw"] = { 54 },
["road_right"] = { 34, 42, 50, 58 },
["road_up"] = { 44, 45, 46, 47 },
["road_without_ne"] = { 61 },
["road_without_nw"] = { 60 },
["road_without_se"] = { 56 },
["road_without_sw"] = { 57 },
}

View File

@ -0,0 +1,45 @@
return {
tileSize = 32,
grass = {
x1 = 0,
y1 = 0,
x2 = 96,
y2 = 96
},
grass_flower = {
x1 = 96,
y1 = 0,
x2 = 224,
y2 = 96
},
road = {
x1 = 0,
y1 = 128,
x2 = 32,
y2 = 192
},
road_rightside = {
x1 = 64,
y1 = 128,
x2 = 64,
y2 = 224
},
road_leftside = {
x1 = 96,
y1 = 128,
x2 = 96,
y2 = 224
},
road_downside = {
x1 = 128,
y1 = 128,
x2 = 224,
y2 = 128
},
road_upside = {
x1 = 128,
y1 = 160,
x2 = 224,
y2 = 160
}
}

View File

@ -1,24 +1,26 @@
local serpent = require('dev_utils.serpent')
--- DEPRECATED BY CHATGPT
--- @type {[string]: any}
local out = {
tileSize = tonumber(arg[1])
}
-- local serpent = require('dev_utils.serpent')
local idx = ""
-- --- @type {[string]: any}
-- local out = {
-- tileSize = tonumber(arg[1])
-- }
for i = 0, #arg - 2, 5 do
local cnt = 1
idx = arg[i + 2]
out[idx] = {}
for x = tonumber(arg[i + 3]), tonumber(arg[i + 5]), tonumber(out.tileSize) do
for y = arg[i + 4], arg[i + 6], out.tileSize do
out[idx][idx .. cnt] = { quad = { x = x, y = y, w = out.tileSize, h = out.tileSize } }
cnt = cnt + 1
end
end
end
-- local idx = ""
print("return " .. serpent.block(out))
-- for i = 0, #arg - 2, 5 do
-- local cnt = 1
-- idx = arg[i + 2]
-- out[idx] = {}
-- for x = tonumber(arg[i + 3]), tonumber(arg[i + 5]), tonumber(out.tileSize) do
-- for y = arg[i + 4], arg[i + 6], out.tileSize do
-- out[idx][idx .. cnt] = { quad = { x = x, y = y, w = out.tileSize, h = out.tileSize } }
-- cnt = cnt + 1
-- end
-- end
-- end
-- command for test: luajit dev_utils/tile_generator.lua 32 grass 0 0 96 96 flower_grass 96 0 192 96 >> assets/tiles/grass/manifest2.lua
-- print("return " .. serpent.block(out))
-- -- command for test: luajit dev_utils/tile_generator.lua 32 grass 0 0 96 96 flower_grass 96 0 224 96 >> assets/tiles/grass/manifest2.lua

View File

@ -77,7 +77,7 @@ function love.draw()
love.graphics.setColor(1, 0, 0)
for _, p in ipairs(path) do
love.graphics.rectangle("line", p.x, p.y, 0.1, 0.1)
love.graphics.rectangle("fill", p.x, p.y, 0.1, 0.1)
end
love.graphics.setColor(1, 1, 1)
end