JavaScript mapping classes and random generation algorithms JavaScript mapping classes and random generation algorithms
- Setup
- Usage
- Examples
- Templates
- Basic
- Clustered Rooms - Default
- Clustered Rooms - Small
- Clustered Rooms - Large
- Clustered Rooms - Long Hallways
- Clustered Rooms - Wild
- Clustered Rooms - Winding
- Diffuse Corridors - Default
- Diffuse Corridors - Catacombs
- Diffuse Corridors - Connected
- Diffuse Corridors - Deadends
- Diffuse Corridors - External
- Diffuse Corridors - Separated
- Organized Rooms
- Patterned Rooms
- Landforms
Getting started is as easy as npm i @ion-cloud/compass --save
and then importing
the required modules into your app with import {Map,Sector,maps} from '@ion-cloud/compass'
.
Please see code example here.
import {EaselWebGL} from '@ion-cloud/easel';
import {Map,maps,BasicWebGLDisplay} from '@ion-cloud/compass';
const easel = new EaselWebGL(),
map = new Map({width:100,height:100}),
display = new BasicWebGLDisplay({easel,map}),
{generator} = maps.find(map=> map.name==='template - basic');
generator({map});
easel.onDraw = function(){ display.draw(); };
easel.redraw();
import {Easel} from '@ion-cloud/core';
import {Map,maps,BasicDisplay} from '@ion-cloud/compass';
const easel = new Easel(),
map = new Map({width:100,height:100}),
display = new BasicDisplay({easel,map}),
{generator} = maps.find(map=> map.name==='template - basic');
generator({map});
easel.onDraw = function(){ display.draw(); };
easel.redraw();