A guide to Phaser States from CodeToWin

Posted on 14th Aug 2015. Follow @phaser_ and get the Phaser World newsletter.

image

From the CodeToWin blog: "Wait.. .what time is it? It’s time for another tutorial! Today, I am going to dive into the code behind the nBack game, and show you how I created the very simple intro screen that doubles as a game options and instructions screen. The concepts presented here can be extended to include different screens for the instructions as well as the options.

The summary is the following: Each Phaser game has what are called “states”. This is much like states in a real life sports game. For American football, you have pregame states, where we are inundated with pointless advertisements and the musings of old has beens on who is going to win the game. The game itself is a state, that has timeout states interspersed throughout. You also have challenge states, when a coach wants to challenge a ruling on the field. You can generalize this to any sport you are familiar with, to gain some basic understanding."

Read More

Learn to code and lead your intrepid crew on a mission to save The Cloud in TwilioQuest, a PC role-playing game inspired by classics of the 16-bit era. Free forever, and available now for Windows, Mac, and Linux.

The first book on the creation of HTML5 cross platform games using Phaser 3 and other free software.
  • By Emanuele Feronato
  • 155 Pages
  • 28 Source Code Examples
  • Build a complete game from start to finish
  • Cross Platform
  • Scaling for devices
Buy Now
$19