A collection of concrete examples for various game mechanics, algorithms, and effects. The examples are all implemented in JavaScript using the Phaser game framework, but the concepts and methods are general and can be adapted to any engine. Think of it as pseudocode. Each section contains several different examples that progress in sequence from a very basic implementation to a more advanced implementation. Every example is interactive and responds to keyboard or mouse input (or touch). More...

Follow @yafd on Twitter

Questions, corrections, want to hire me? Contact me on Twitter or email.

Copyright © 2022 John Watson

The example source code is licensed under the terms of the MIT License. Art assets in the examples are licensed under the Creative Commons Attribution license (CC BY 3.0).

Download all assets

This site requires a modern web browser that supports HTML5. I recommend Chrome and Firefox.