Minimum Viable Product
Besides this readme and the source files, there are no docs, tests or optimizations yet. Here be Dragons.
This starter kit and mini-framework for LittleJS is intended to simplify the architecture for complex games. It supports running multiple LittleJS games simultaneously (if desired) by moving the game logic into runtime modules called GameScopes and iterating through these scopes in the game loop.
For a minimalist example, see the Blank GameScope.
For a simple menu example, see the MainMenu GameScope.
Several flags are available to customize how GameScopes are executed:
scopedUpdate
: If true, a GameScope will only have it's update method called if it is the currently active scope. Set to false to keep a scope running in the background.scopedRender
: If true, a GameScope will only have it's render method called if it is the currently active scope. Set to false if you want to keep rendering in the background.
The following GameScope properties should be checked in your GameScope's gameUpdate()
handlers:
scopedKeyboard
: If true, a GameScope should only process keyboard inputs when it is the active scopescopedMouse
: If true, a GameScope should only process mouse inputs when it is the active scopescopedGamepad
: If true, a GameScope should only process gamepad inputs when it is the active scope
Note: Requires Node.js
git clone git@github.com:psema4/littlejs-starter-kit.git
cd littlejs-starter-kit
git checkout develop
npm i
Note: Requires Bash and Node.js
npm run build
Or to build and run the development server:
npm run server
and open a browser to http://localhost:8090/
- Multiple tile/sprite sets
- Global, scoped timers & clocks
- Common library functions (see also gameEffects.js from the LittleJS platformer example for a nice background generator)