2013-08-29 06:06:16 +00:00
|
|
|
/**
|
|
|
|
* State
|
|
|
|
*
|
2013-09-13 04:44:04 +00:00
|
|
|
* This is a base State class which can be extended if you are creating your own game.
|
2013-08-29 06:06:16 +00:00
|
|
|
* It provides quick access to common functions such as the camera, cache, input, match, sound and more.
|
|
|
|
*
|
|
|
|
* @package Phaser.State
|
|
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
|
|
* @copyright 2013 Photon Storm Ltd.
|
|
|
|
* @license https://github.com/photonstorm/phaser/blob/master/license.txt MIT License
|
|
|
|
*/
|
|
|
|
|
|
|
|
Phaser.State = function () {
|
2013-09-10 19:40:34 +00:00
|
|
|
|
|
|
|
this.game = null;
|
|
|
|
this.add = null;
|
|
|
|
this.camera = null;
|
|
|
|
this.cache = null;
|
|
|
|
this.input = null;
|
|
|
|
this.load = null;
|
2013-09-13 04:44:04 +00:00
|
|
|
this.math = null;
|
2013-09-10 19:40:34 +00:00
|
|
|
this.sound = null;
|
|
|
|
this.stage = null;
|
|
|
|
this.time = null;
|
|
|
|
this.tweens = null;
|
|
|
|
this.world = null;
|
|
|
|
this.particles = null;
|
|
|
|
this.physics = null;
|
|
|
|
|
2013-08-29 06:06:16 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
Phaser.State.prototype = {
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Override this method to add some load operations.
|
|
|
|
* If you need to use the loader, you may need to use them here.
|
|
|
|
*/
|
|
|
|
preload: function () {
|
|
|
|
},
|
|
|
|
|
|
|
|
/**
|
|
|
|
* This method is called after the game engine successfully switches states.
|
2013-09-18 05:34:56 +00:00
|
|
|
* Feel free to add any setup code here.(Do not load anything here, override preload() instead)
|
2013-08-29 06:06:16 +00:00
|
|
|
*/
|
|
|
|
create: function () {
|
|
|
|
},
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Put update logic here.
|
|
|
|
*/
|
|
|
|
update: function () {
|
|
|
|
},
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Put render operations here.
|
|
|
|
*/
|
|
|
|
render: function () {
|
|
|
|
},
|
|
|
|
|
|
|
|
/**
|
|
|
|
* This method will be called when game paused.
|
|
|
|
*/
|
|
|
|
paused: function () {
|
|
|
|
},
|
|
|
|
|
|
|
|
/**
|
|
|
|
* This method will be called when the state is destroyed
|
|
|
|
*/
|
|
|
|
destroy: function () {
|
|
|
|
}
|
|
|
|
|
|
|
|
};
|