A Guide to the Phaser State Manager
This book is 60% complete
Last updated on 2015-09-10
About the Book
States are the way in which Phaser allows you to break your game down into manageable chunks. You could have a State for the Preloader, MainMenu, the main Game, GameOver screen and more. How far you go in breaking your game down is up to you, but it's all handled through the Phaser State Manager.
In this guide we'll explore exactly how the State Manager works. We'll cover creating states, swapping between them, structuring your project to take advantage of them and common issues to look out for. It also covers how you access the various Phaser sub-systems from within a State, which properties and methods are created automatically and what they all do.
The book also covers exactly how we break down our code at Photon Storm for all our client games. You don't have to follow this approach of course, but at the very least you may get some ideas from it.
By the end of the book you should have progressed from the "all in one file global" approach and found new ways to structure your code, allowing for easier maintenance and clarity in the process.
The Leanpub 45-day 100% Happiness Guarantee
Within 45 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.
See full terms
Free Updates. DRM Free.
If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).
Most Leanpub books are available in PDF (for computers), EPUB (for phones and tablets) and MOBI (for Kindle). The formats that a book includes are shown at the top right corner of this page.
Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.