Dungeon generators

This family of map generators produces corridors and rooms. Room information can be retrieved after the map has been created by calling getRooms(); corridor information can be retrieved via getCorridors():

ROT.RNG.setSeed(1234); var map = new ROT.Map.Digger(); var display = new ROT.Display({fontSize:8}); SHOW(display.getContainer()); map.create(display.DEBUG); var rooms = map.getRooms(); for (var i=0; i<rooms.length; i++) { var room = rooms[i]; SHOW("Room #%s: [%s, %s] => [%s, %s]".format( (i+1), room.getLeft(), room.getTop(), room.getRight(), room.getBottom() )); }

Digger

Random dungeon generator using human-like digging patterns; based on Mike Anderson's ideas from the "Tyrant" algo, mentioned at Roguebasin. Third constructor argument is a configuration object; allowed options:

var w = 40, h = 25; var map = new ROT.Map.Digger(w, h); for (var i=0; i<4; i++) { var display = new ROT.Display({width:w, height:h, fontSize:6}); SHOW(display.getContainer()); map.create(display.DEBUG); }

Uniform

Generates a set of rooms; tries to connect them afterwards. Third constructor argument is a configuration object; allowed options:

var w = 40, h = 25; var map = new ROT.Map.Uniform(w, h); for (var i=0; i<4; i++) { var display = new ROT.Display({width:w, height:h, fontSize:6}); SHOW(display.getContainer()); map.create(display.DEBUG); }