Skip to content

Commit ef610c7

Browse files
committed
Added init to State template class.
1 parent 269af69 commit ef610c7

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

src/core/State.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,16 @@ Phaser.State = function () {
102102

103103
Phaser.State.prototype = {
104104

105+
/**
106+
* init is the very first function called when your State starts up. It's called before preload, create or anything else.
107+
* If you need to route the game away to another State you could do so here, or if you need to prepare a set of variables
108+
* or objects before the preloading starts.
109+
*
110+
* @method Phaser.State#init
111+
*/
112+
init: function () {
113+
},
114+
105115
/**
106116
* preload is called first. Normally you'd use this to load your game assets (or those needed for the current State)
107117
* You shouldn't create any objects in this method that require assets that you're also loading in this method, as

0 commit comments

Comments
 (0)