Updated all Game Objects so they all have preUpdate, update and postUpdate functions (even if empty). Updated World so when it iterates through them all it no longer checks if those functions are present before calling them. Was wasting a lot of time doing that before.

This commit is contained in:
photonstorm
2014-02-14 01:09:52 +00:00
parent f9a4beb608
commit 3e99391cbf
6 changed files with 74 additions and 55 deletions
+12 -2
View File
@@ -153,10 +153,10 @@ Phaser.Sprite = function (game, x, y, key, frame) {
* 4 = fresh? (0 = no, 1 = yes)
* 5 = outOfBoundsFired (0 = no, 1 = yes)
* 6 = exists (0 = no, 1 = yes)
* @property {array} _cache
* @property {Int16Array} _cache
* @private
*/
this._cache = [0, 0, 0, 0, 1, 0, 1];
this._cache = new Int16Array([0, 0, 0, 0, 1, 0, 1]);
/**
* @property {Phaser.Rectangle} _bounds - Internal cache var.
@@ -272,6 +272,16 @@ Phaser.Sprite.prototype.preUpdate = function() {
};
/**
* Override and use this function in your own custom objects to handle any update requirements you may have.
*
* @method Phaser.Sprite#update
* @memberof Phaser.Sprite
*/
Phaser.Sprite.prototype.update = function() {
};
/**
* Internal function called by the World postUpdate cycle.
*