starshipwright
v1.1.2
Published
Generate 2D starships
Downloads
6
Readme
Starshipwright
JS library to procedurally generate starships. Based on a procedural generation monthly challenge entry from Reddit by green_meklar, used with permission.
Installation
# npm
npm install starshipwright --save
# yarn
yarn add starshipwright
Usage
import { generateShip, generateFactionRandomizer } from 'starshipwright';
...
const faction = generateFactionRandomizer("factionRandomSeed");
const ship = generateShip(faction, "shipRandomSeed"); // HTML Canvas
API
generateFactionRandomizer(seed: string) ⇒ Randomizer
Returns a randomizer initialized with the specified seed.
generateShip(faction: Randomizer, seed: string, size?: number) ⇒ Randomizer
Returns a canvas that contains the generated ship.
Demo
Check it out here.