0.3.0-alpha.11 • Published 4 years ago

whirljs v0.3.0-alpha.11

Weekly downloads
3
License
MIT
Repository
github
Last release
4 years ago

Features

Whirl's aim is to allow you to to quickly and easily create games in the browser; allowing you to create, extend and import game objects and plugins, making its functionality highly extendable outside of its many already included core features.

Some features offered by the Whirl game engine are:

  • Dynamic custom event system that allows for the creation and broadcasting of events across game objects.
  • Child-parent tree architecture of game objects that allows you to easily organise your game world into a managable hierarchy of objects.
  • State-like world system that makes it easy to load, unload and switch your scene or level instantly.
  • Modularised viewport manager that enables you to create multiple game viewports and screens without the need for multiple canvas elements, stacked HTML elements or duplicate game instances.
  • Flexibility-first approach that makes it easy to create your own custom plugins and game objects that can be exported and reused - objects are flexible, modular and easy to work with.

Installation and Usage

Install:

# npm
npm install whirljs

# Yarn
yarn add whirljs

Use:

// ES modules
import Whirl from "whirljs";

// UMD
window.Whirl;

Create a game:

const game = Whirl
    .createGame()
    .start();

Examples

Example usage of the various features of Whirl are included in the examples/scripts/ directory. Feel free to change and play around with them yourself!

Simply clone the repository, build the source and open up examples/Sandbox/index.html to use the in-browser code editor and get started with Whirl.

Build from Source

Whirl takes advantage of webpack to compile its source code down into a single, universally compatible JavaScript file.

  1. Clone the repository - git clone <repository url>.
  2. Install dependencies - npm i or yarn.
  3. Build from source - npm run build or yarn run build.

Once completed, you can find the built file in /build/whirl.js.

Build the Docs

Whirl uses JSDoc to write and generate its documentation.

  1. Clone the repository - git clone <repository url>.
  2. Install dependencies - npm i or yarn.
  3. Build the documentation - npm run doc or yarn run doc.

Once completed, you can find the generated documentation files in the doc/ directory, with index.html being the home page.