Skip to content
Please note that GitHub no longer supports your web browser.

We recommend upgrading to the latest Google Chrome or Firefox.

Learn more
Astray is a lua based maze, room and dungeon generation library for dungeon crawlers and rougelike video games
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
astray
LICENSE
README.md readme updated with infos to set initial dungeonsize Dec 12, 2016
conf.lua fi xfor löve 0.10.0 Jun 2, 2016
main.lua
sample.png -sample added Sep 28, 2015

README.md

Astray

Astray is a lua based maze, room and dungeon generation library for dungeon crawlers and rougelike video games.

Quick Look

local astray = require('astray')

-- This maze generator can only generate uneven maps.
-- To get a 39x39 maze you need to Input
local height, width = 40, 40
--	Astray:new(width/2-1, height/2-1, changeDirectionModifier (1-30), sparsenessModifier (25-70), deadEndRemovalModifier (70-99) ) | RoomGenerator:new(rooms, minWidth, maxWidth, minHeight, maxHeight)
local generator = astray.Astray:new( height/2-1, width/2-1, 30, 70, 50, astray.RoomGenerator:new(4, 2, 4, 2, 4) )

local dungeon = generator:Generate()

local tiles = generator:CellToTiles( dungeon )

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

Documentation

See the github wiki page for examples & documentation.

Installation

Just copy the astray folder wherever you want it (for example on a lib/ folder). Then write this in any Lua file where you want to use it:

local astray = require('lib/astray')

Specs

This work mainly based on the following ideas:

Copyright

Copyright (c) <''2014''> <''Florian Fischer''>

License

Astray is distributed under the zlib/libpng License (http://opensource.org/licenses/Zlib)

You can’t perform that action at this time.