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...

My name is John Watson. Mostly I make internet things for a living. But for the past few years I've been teaching myself game development and participating in jams, something I've wanted to do since I was very young. My goal in creating these examples was to provide a helpful resource for other game developers, particularly those who are just getting started, myself included.

Each example focuses on one concept and includes the source code for the implementation. They aren't meant to be extremely polished or to represent a complete game. They aren't highly optimized. They may not even be the best way to implement the mechanic being demonstrated! (They're certainly not the only way.) They are written for clarity so that it is easier to understand the underlying concepts and apply them to your own work in your own engine. I expect that some of these examples will evolve as I gain experience. But hopefully you'll find them useful and you can use them as a jumping off point for your own games.

This is a work in progress. Contact me if you have questions, corrections, or suggestions. Thanks for visiting! Close