@jasonbdly/wge

1.0.0 • Public • Published

WGE (Web Game Engine)

Overview

This project aims to be a simple yet flexible game engine library with a gentle learning curve.

The entity component system is a core design principle in this library (https://en.wikipedia.org/wiki/Entity_component_system).

For simplicity, the elements of this system have been remapped to:

  • Entity => Thing
  • Component => Modifier
  • System => Processor

Getting Started (Developing a Game with this Engine)

  • Install Node.js (if you don't have it already installed)
    • Node.js: brew install node on OS X
  • Create a new project to contain your game application files
  • Install this game engine module as a dependency:
    • npm i @jasonbdly/wge
  • Set up your game files index.html and index.js
    • TODO: Provide additional details here + user documentation
  • Run (You'll need some sort of build-system or basic http server at a minimum. I recommend using Parcel just as the engine itself has done).
    • parcel src/index.html
    • parcel build src/index.html

Getting Started (Developing Enhancements for the Engine Itself)

  • Install Node.js (if you don't have it already installed)
    • Node.js: brew install node on OS X
  • Clone the engine repo git clone git@gitlab.com:jasonbdly/WebGameEngine.git
  • Install all local dependencies:
    • npm i
  • Choose an existing demo application to start in watch mode for testing changes (or create a new one):
    • npm run dev:<game-name> (npm run dev:block-game)
  • Commit changes, create pull requests, etc

Project Structure

* demos
    * <Contains assets for all included engine demo applications>
* src
    * <Source code directory containing built-in modifiers/processors and core engine code>
    * modifiers
        * <Contains built-in modifiers and related core engine code>
    * processors
        * <Contains built-in processors and related core engine code>
    * things
        * <Contains core engine code for managing Things and generating them at runtime>
    * utils
        * <Contains core engine utility functions used throughout the engine>
* test
    * <Contains test assets for the engine. This includes testing and demo resources>

Development Workflow

Develop

Since this is just the engine library code, there's not much a developer can do to test new features without a demo application that uses those features. For this reason, it is necessary for developers to target a specific application when they start up the development server.

Refer to the npm.scripts section in package.json for a list of the existing demo applications and how to start them. Parcel will pick up the target app's entry point and use it to detect the necessay resources from the engine.

When creating new demo applications, please add an entry for them in npm.scripts in package.json to ensure they are readily available to other developers.

Starting the Development Server

This example works with the block-game demo application included with the engine.

To start the development server with this application you simply need to run npm run dev:block-game.

Production

Production mode may involve building either the internal engine OR a game that uses the engine.

Build Engine

npm run prod:engine

Build Game

TODO

Release Workflow

  1. Bump package version and create version tag
    • npm version patch
    • npm version minor
    • npm version major
  2. Push new version to npm registry (the package will build itself prior to publishing)
    • npm run npm:publish

OLD README BELOW

# Brunch + Babel/ES6

This is a modern JS skeleton for Brunch.

Installation

Clone this repo manually or use brunch new dir -s es6

Getting started

  • Install (if you don't have them):
    • Node.js: brew install node on OS X
    • Brunch: npm install -g brunch
    • Brunch plugins and app dependencies: npm install
  • Run:
    • npm start — watches the project with continuous rebuild. This will also launch HTTP server with pushState.
    • npm run build — builds minified project for production

ES-next

To use proposed JS features not included into ES6, do this:

  • npm install --save-dev babel-preset-stage-0
  • in brunch-config.js, add the preset: presets: ['latest', 'stage-0']

Readme

Keywords

Package Sidebar

Install

npm i @jasonbdly/wge

Weekly Downloads

0

Version

1.0.0

License

MIT

Unpacked Size

83 kB

Total Files

7

Last publish

Collaborators

  • jasonbdly