procedural-map
Two-dimensional maps generator using procedural generation from a seed. For seedless random generation, check out random-walk-map.
Installation
Install via npm:
$ npm install --save procedural-map
Usage
Call the function exposed by the package to generate a two-dimensional map with connected paths. It returns a matrix (an array of arrays), where each postion contains 0 (default) or 1 (a path).
let generateMap = ; //Generate a map with default config let map = ; /* Example output: * map =[[0, 0, 0, 0, 1], * [0, 0, 0, 0, 1], * [0, 1, 1, 0, 1], * [0, 0, 1, 1, 1], * [0, 0, 0, 0, 0]] */
Configuration
The generator can take a config object as second parameter, with any of the following parameters:
let map = ;