A (currently Phaser-based) skeleton project for game jam entries. WIP.
- Basic websocket message relay for easy multiplayer/multi-device prototyping
- Webpack + Babel setup for ES modules with import/export, ES6 features etc
- webpack-dev-server with live reload
- Phaser CE, PIXI and P2 available as vendor imports
- Project directory structure w/READMEs
- Skeleton modules for game setup, core states, asset loading and player control
- Barebones HTML and CSS shell
- StandardJS linting with some additional rules for basic error-catching and brevity
dist
directory output for ease of deployment
Ensure you have Node and npm installed.
- Clone/download the repo (delete the
.git
directory if present) - Run
npm install
- Run
npm start
- Visit
localhost
on port 8080 - Add/edit game logic in
/src/game
npm run <scriptname>
start
- runs the Webpack dev server, builds the app, serves it on localhost while watching for changes and live-reloading as needed.build
- performs a production build (minified etc) to the/dist
directory.
- Basic states created -
startup
,title
andplay
states are already in place and wired up. - Easier game object handling - includes helper methods and factories to more easily add game objects to the state, with suitable defaults (e.g. centred anchor position).
- Prototyping helpers - placeholder actors, auto-controls, and other quick-start helper modules for easier idea prototyping.
- Asset preloading tools - contains a helper method to load a manifest of assets, and a basic UI text component to report progress.
- Jump to state via URL hash - a state defined in
game/states/index.js
can be jumped to by passing its name in the URL hash e.g.localhost:8080/#play
will jump to theplay
state, if defined. Note: this only works on initial page load; there is no HTML5 History integration and the state will not respond to hash changes once the page has loaded. - HTML page shell - barebones styled HTML and CSS shell, with Canvas placeholder text and centred layout.
- All game-related code lives in the
/src/game
directory. /src/game/states/startup.js:preload()
is the first code executed after the game instance has been created./src/kit
contains helpers and UI components to assist in development; check the source for details.- New states should be defined in
/src/game/states/<statename>.js
and added to theindex.js
file in that directory before use; it will automatically be registered when the game boots.
/src/game/index.js
is the Webpack entrypoint of the app (it should not require editing).Phaser
must beimport
ed before use in a module e.g.import Phaser from 'phaser'
.- Imports will be resolved to the
/src/game
directory automatically, so you can import fromhelpers/
,states/
etc without having to specify the full path. - Imports will also resolve to the
/src
directory, so you can access skeleton helpers by importing fromkit/*
without having to specify the full path. - The build pipeline outputs two bundles:
vendor
for Phaser and its dependencies, andindex
for the game code.
import
ing a media file (image, video, audio) will get the URL from which that file is served at runtime (see the Webpack config).- Assets should be placed in
/src/game/assets
,import
ed into a module and loaded via thesrc/kit/helpers/loading.js
helper or using Phaser's owngame.load.*
methods. (See the skeleton'stitle
state for an example of this usage.)
ESLint is used to provide IDE warnings as appropriate, though no hooks are currently present to prevent lint errors from being committed and pushed.
Lint rules are StandardJS and ESLint recommended, combined, with the following warnings added:
- Warn for
console
statements apart frominfo
,warn
anderror
(will keep output clean over time, and help debugging) - Warn for semicolons (can be used if you really want to)
- Warn for missing trailing commas in multiline declarations
See also https://njmcode.github.io/blog/2017/04/02/lessons-learned-gamecraft-2017.html
- Make it work
- Make it fun
- Make it polished
- Fun gameplay
- Core game mechanics & play loop
- Player controls & tactility
- Success/failure feedback
- Sense of player agency and involvement
- Metric of success - win screen, trackable score, levels etc
- Minimum required in-game graphics and sound
- Anything that imparts a sense of joy, excitement, fear etc
- Frontend aesthetics (menus, title, logos etc)
- Complex animation
- Custom music (unless a music or horror-based game)
- User customization (options, tweaks etc)
- Massive variety of content
- Special effects
* unless integral to the core gameplay loop