New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

create-world

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

create-world

---

0.0.2
latest
npm
Version published
Weekly downloads
8
700%
Maintainers
1
Weekly downloads
 
Created
Source

create-world

Create procedurally generated 2D worlds

Add a short introduction here.

:sparkles: Features

:wrench: Example usage

const world = createWorld({}) const generatedTiles = generateArea(world)({ x: 1, y: 0 })

:package: Install

npm

npm install create-world

yarn

yarn add create-world

:newspaper: API

:book: 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,
    },
  ],
})

:computer: Develop

Commands

CommandDescription
yarn buildGenerate files in the dist folder
yarn releaseStart the process to release a new version
yarn typecheckRun a type check with typescript
yarn lintLint with eslint
yarn cleanRemove build artefact (.tgz file)
yarn build-testBuilds, packs and installs to example folder

Workflow

  • Make changes
  • yarn build-test and verify that your changes work.
  • Commit to master or make PR
Release
  • yarn release:prepare - Sets up your library for release
  • If everything worked in the previous step: yarn release

FAQs

Package last updated on 07 Apr 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts