Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Geração do mapa "?" #5

Open
wilsonbrito opened this issue Jan 5, 2025 · 0 comments
Open

Geração do mapa "?" #5

wilsonbrito opened this issue Jan 5, 2025 · 0 comments

Comments

@wilsonbrito
Copy link

No print do mapa está reportando "?" pelo que eu venho debugando, está me parecendo ser um problema no ASC2.
Mas eu não tenho dominio completo para aformar. Segue código exemplo:

local astray = require('astray.astray')

-- Initialize generator with desired parameters
-- Note: Astray generates uneven-sized maps (e.g., 39x39 from 40x40 input)
local height, width = 40, 40
local generator = astray.Astray:new(
width/2-1, -- Map width
height/2-1, -- Map height
30, -- Change direction modifier (1-30)
70, -- Sparseness modifier (25-70)
50, -- Dead end removal modifier (50-99)
astray.RoomGenerator:new( -- Room generator configuration
4, -- Number of rooms
2, 4, -- Min/Max room width
2, 4 -- Min/Max room height
)
)

-- Generate dungeon
local dungeon = generator:Generate()

-- Convert to ASCII tiles
local tiles = generator:CellToTiles(dungeon)

-- Print the dungeon
for y = 0, #tiles[1] do
local line = ''
for x = 0, #tiles do
line = line .. tiles[x][y]
end
print(line)
end

Retorno:
Captura de Tela 2025-01-05 às 01 56 14

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant