create-world
Create procedurally generated 2D worlds
Add a short introduction here.
✨ Features
🔧 Example usage
const world = createWorld({}) const generatedTiles = generateArea(world)({ x: 1, y: 0 })
📦 Install
npm
npm install create-world
yarn
yarn add create-world
📰 API
📖 Recipes
Mud-world:
const TileType = {
WATER: 'water',
MUD: 'mud',
}
const FeatureType = {
LOG: 'log',
}
const world = createWorld({
// order matters since resulting tiles will be first type matched
tiles: [
{ type: TileType.WATER, noiseMax: -0.3 },
// default tile so that something is always matched
{ type: TileType.MUD },
],
features: [
{
type: FeatureType.LOG,
tileTypesAllowed: [TileType.MUD],
likelihood: 5,
},
],
})
💻 Develop
Commands
Command | Description |
---|---|
yarn build |
Generate files in the dist folder |
yarn release |
Start the process to release a new version |
yarn typecheck |
Run a type check with typescript |
yarn lint |
Lint with eslint |
yarn clean |
Remove build artefact (.tgz file) |
yarn build-test |
Builds, packs and installs to example folder |
Workflow
- Make changes
yarn build-test
and verify that your changes work.- Commit to
master
or makePR
Release
yarn release:prepare
- Sets up your library for release- If everything worked in the previous step:
yarn release