fridays18 wrote: ↑Sat Dec 17, 2022 9:09 pm
Would you happen to know any tutorials or areas to learn about how to use it since the docs are kinda just a command dump?
I don't know the docs seem to have a lot. Even examples.
--[[ Uniform ]]
ROT= require 'src.rot'
update= false
function love. load()
f =ROT.Display( 80 , 24 )
uni=ROT.Map.Uniform(f:getWidth(), f:getHeight())
update= true
end
function love.draw() f:draw() end
function calbak(x, y, val) f:write(val== 1 and '#' or '.' , x, y) end
function love.update()
if update then
update= false
uni:create(calbak)
local rooms=uni:getDoors()
for k,v in pairs (rooms) do
f:write( '+' , v.x, v.y)
end
end
end
function love.keypressed(key) update= true end
Most of the maps just decide if an x,y position is solid or not and let you decide how to deal with that in the callback. Pretty Straight forward.
The risk I took was calculated,
but man, am I bad at math.
fridays18 wrote: ↑Sat Dec 17, 2022 9:09 pm
Would you happen to know any tutorials or areas to learn about how to use it since the docs are kinda just a command dump?
I don't know the docs seem to have a lot. Even examples.
--[[ Uniform ]]
ROT= require 'src.rot'
update= false
function love. load()
f =ROT.Display( 80 , 24 )
uni=ROT.Map.Uniform(f:getWidth(), f:getHeight())
update= true
end
function love.draw() f:draw() end
function calbak(x, y, val) f:write(val== 1 and '#' or '.' , x, y) end
function love.update()
if update then
update= false
uni:create(calbak)
local rooms=uni:getDoors()
for k,v in pairs (rooms) do
f:write( '+' , v.x, v.y)
end
end
end
function love.keypressed(key) update= true end
Most of the maps just decide if an x,y position is solid or not and let you decide how to deal with that in the callback. Pretty Straight forward.