mirror of
https://github.com/wassname/phaser.git
synced 2026-07-09 00:20:17 +08:00
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:
@@ -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.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user