This page is work-in-progress. You can reach me on twitter or mail to


Use Q W E to switch states

States are easy way to split application in smaller logical divisions like:

Intro, Menu, Game, Options, Credits, Loading screen.

Create a namespace to hold states

var ENGINE = {};

Create a state

ENGINE.Game = {

  create: function() {

    /* this is called when the state is entered for the very first time */


  step: function(delta) {


  render: function(delta) {"#008");



Select application state

app = playground({

  ready: function() {




Ask question:

Fork me on GitHub