node-voronoi-map

0.0.3 • Public • Published

voronoi-map-node-js

JavaScript nodejs port of Amit Patel's mapgen2 https://github.com/amitp/mapgen2 Map generator for games. Generates island maps with a focus on mountains, rivers, coastlines in nodejs.

Based on the awesome work from Amit Patel and the js port from Richard Janicek.

Try the demo from Richard Janicek

Install me from NPM

Fork me on GitHub

Installation & usage

Using npm:

npm install --save node-voronoi-map
var MapGenerator = require('node-voronoi-map');
var mapGenerator = new MapGenerator({
    width:1920,
    height:960,
    seed:992878989,
    shapeSeed:60441019,
    islandShape:'perlin',
    pointSelection:'square',
    oceanRatio:0.5,
    islandFactor:1.07, //1.0 means no small islands; 2.0 leads to a lot
    numberOfLands:'',
    numberOfPoints:200,
    lakeThreshold:0.3,
    riverChance:100,
    roadElevationThresholds:'0, 0.05, 0.37, 0.64',//comma separated
});
var map = mapGenerator.generate();

Tasks

  • implement generate Map from Image

Package Sidebar

Install

npm i node-voronoi-map

Weekly Downloads

4

Version

0.0.3

License

MIT

Last publish

Collaborators

  • mrmoor