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
-
Node.js:
- Create a new project to contain your game application files
-
NPM Init:
npm init
-
NPM Init:
- Install this game engine module as a dependency:
npm i @jasonbdly/wge
- Set up your game files
index.html
andindex.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
-
Node.js:
- 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
- Bump package version and create version tag
npm version patch
npm version minor
npm version major
- Push new version to npm registry (the package will build itself prior to publishing)
npm run npm:publish
OLD README BELOW
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):
- 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']