The State Machine and Scenes

A typical game will include multiple states during its existence. A state can be one of many different scenes in a game, including a home screen, a leaderboard, a settings menu, the game itself, and many others. A game can consist of a few or many states, and the management system to assure that only one state is running at a time is an important technique in game development. The collective components that make up this management system are referred to as a state machine.

This chapter will take a close look at each area that makes up a state machine, and then you’ll put your new knowledge into practice ...

Get Beginning HTML5 Games with CreateJS now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.