@theNeedle: That was an very interesting read, thanks for the link. However, it did not answer all my questions. My first guess was that the object in question is indeed a scene object, but Phaser.Scene does not define a preload() nor a create() method. But then in the first code snippet the class extending Phaser.Scene does define a create() function. I’m confused, how that function is ever going to be called.
@samme: Could you please expand on your answer a little bit? My first question would be, why is this nowhere documented? Or am I missing some basic understanding and this should go without further explanation?
The init() function you mentioning I’m seeing for the first time. I also would like to know, what exactly is the difference between the preload() and the create() function? They’re both called before the game runs, right?
And I’m pretty sure, the update() function has parameters. Maybe the same as the update() function documented in Phaser.Scene? Now I’m wondering, maybe the other functions have some parameters as well?
init(), preload(), and create() are called when the scene is started. If the loader has items queued after preload() completes, then it starts automatically, and create() is called only after the loading is complete.
The next release will include these methods in the Phaser.Scene docs. They’re identical to the methods with the same names in a scene config object.
Any properties on extend are copied onto the scene after it’s created.
this rex-note (especially the flowchart) will help in understanding how scene methods are called. Dev log #119 that samme shared is absolute gem. It cleared out some of my doubts too.