From 1646157c0cd2f471b5a0e44d6a9bf1c117cac497 Mon Sep 17 00:00:00 2001 From: photonstorm Date: Tue, 25 Feb 2014 14:54:56 +0000 Subject: [PATCH] Fixed documentation error. --- src/core/StateManager.js | 89 +++------------------------------------- 1 file changed, 5 insertions(+), 84 deletions(-) diff --git a/src/core/StateManager.js b/src/core/StateManager.js index 1515a193..a67c0963 100644 --- a/src/core/StateManager.js +++ b/src/core/StateManager.js @@ -259,85 +259,6 @@ Phaser.StateManager.prototype = { } } - -/* if (this.game.isBooted === false) - { - this._pendingState = key; - - if (arguments.length > 3) - { - this._args = Array.prototype.splice.call(arguments, 3); - } - - return; - } - else - { - // If we still have a _pendingState it's left over from game boot, so glob the args - if (this._pendingState) - { - this._pendingState = null; - } - else - { - this._args = []; - } - } - if (arguments.length > 3) - { - this._args = Array.prototype.splice.call(arguments, 3); - } - - if (this.checkState(key) === false) - { - return; - } - else - { - // Already got a state running? - if (this.current) - { - this.onShutDownCallback.call(this.callbackContext, this.game); - } - - if (clearWorld) - { - this.game.tweens.removeAll(); - - this.game.world.destroy(); - - if (clearCache === true) - { - this.game.cache.destroy(); - } - } - - this.setCurrentState(key); - } - - if (this.onPreloadCallback) - { - this.game.load.reset(); - this.onPreloadCallback.call(this.callbackContext, this.game); - - // Is the loader empty? - if (this.game.load.totalQueuedFiles() === 0) - { - this.game.loadComplete(); - } - else - { - // Start the loader going as we have something in the queue - this.game.load.start(); - } - } - else - { - // No init? Then there was nothing to load either - this.game.loadComplete(); - } - */ - }, /** @@ -349,11 +270,9 @@ Phaser.StateManager.prototype = { }, /** - * Checks if a given phaser state is valid. - * State must exist and have at least one callback function registered.. - * @method Phaser.StateManager#checkState - * @param {string} key - The key of the state you want to check. - * @return {boolean} Description. + * preUpdate is called right at the start of the game loop. It is responsible for changing to a new state that was requested previously. + * + * @method Phaser.StateManager#preUpdate */ preUpdate: function () { @@ -502,6 +421,8 @@ Phaser.StateManager.prototype = { this.onInitCallback.apply(this.callbackContext, this._args); + this._args = []; + }, /**