2016-11-04 02:08:17 +00:00
|
|
|
/**
|
|
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
|
|
* @copyright 2016 Photon Storm Ltd.
|
|
|
|
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* A Base State Class.
|
|
|
|
*
|
|
|
|
* @class Phaser.State
|
|
|
|
* @constructor
|
|
|
|
*/
|
2016-11-04 04:12:18 +00:00
|
|
|
Phaser.State = function (config)
|
2016-11-04 02:08:17 +00:00
|
|
|
{
|
2016-11-06 12:18:08 +00:00
|
|
|
// The properties a State *must* have, that cannot be changed without breaking it:
|
|
|
|
|
2016-11-04 04:12:18 +00:00
|
|
|
this.game = null;
|
|
|
|
|
|
|
|
this.settings = new Phaser.State.Settings(this, config);
|
2016-11-04 02:08:17 +00:00
|
|
|
|
2016-11-06 12:18:08 +00:00
|
|
|
this.sys = new Phaser.State.Systems(this, config);
|
|
|
|
|
|
|
|
// Reference to sys.children, set during sys.init only
|
|
|
|
this.children;
|
2016-11-04 02:08:17 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
Phaser.State.prototype.constructor = Phaser.State;
|
|
|
|
|
|
|
|
Phaser.State.prototype = {
|
|
|
|
|
2016-11-04 05:41:00 +00:00
|
|
|
// Can be overridden by your own States
|
2016-11-04 02:08:17 +00:00
|
|
|
preUpdate: function ()
|
|
|
|
{
|
|
|
|
},
|
|
|
|
|
2016-11-04 05:41:00 +00:00
|
|
|
// Can be overridden by your own States
|
2016-11-04 02:08:17 +00:00
|
|
|
update: function ()
|
|
|
|
{
|
|
|
|
},
|
|
|
|
|
2016-11-04 05:41:00 +00:00
|
|
|
// Can be overridden by your own States
|
2016-11-04 02:08:17 +00:00
|
|
|
postUpdate: function ()
|
|
|
|
{
|
|
|
|
},
|
|
|
|
|
2016-11-04 05:41:00 +00:00
|
|
|
// Can be overridden by your own States
|
2016-11-04 02:08:17 +00:00
|
|
|
render: function ()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
};
|