jjcale Posted February 17, 2017 Share Posted February 17, 2017 Hi all, I am new to Phaser and I would like to understand the difference between Phaser states and custom states. In essence, I understand the following concept very well: var game = new Phaser.Game(800, 600, Phaser.AUTO, '', { preload: preload, create: create, update: update }); function preload() { } function create() { } function update() { // runs 60 time per second } Now, I have seen a lot of examples with custom states (gateways/stages in my game), and again I understand the concept well. Now how do these two concepts work together? How do I use the Phaser 60/s function in my custom states? Yes, this may be a newbie question, but I find Phaser documentation rather complicated. Thank you! JJ Link to comment Share on other sites More sharing options...
jjcale Posted February 17, 2017 Author Share Posted February 17, 2017 I am probably getting it now, each state can define/redefine its own standard Phaser methods: function preload() {} function create() {} function update() {} function render() {} Link to comment Share on other sites More sharing options...
samme Posted February 17, 2017 Share Posted February 17, 2017 1 hour ago, jjcale said: I am new to Phaser and I would like to understand the difference between Phaser states and custom states. They're all the same kind. A state is a set of callbacks comprising an init–preload–create–update/render–shutdown cycle. In simple games (like all the Phaser examples), you're just filling in the methods of the default state. jjcale 1 Link to comment Share on other sites More sharing options...
jjcale Posted February 17, 2017 Author Share Posted February 17, 2017 Perfect. Link to comment Share on other sites More sharing options...
Recommended Posts