mirror of
https://github.com/wassname/phaser.git
synced 2026-08-05 13:21:00 +08:00
Fixed an error that stopped 2 tweens from being able to run on the same object. Also refactored a lot of the classes to remove prototype properties and move them to local instance properties.
This commit is contained in:
+24
-30
@@ -11,10 +11,34 @@
|
||||
*/
|
||||
Phaser.Cache = function (game) {
|
||||
|
||||
/**
|
||||
* Local reference to Game.
|
||||
*/
|
||||
this.game = game;
|
||||
|
||||
/**
|
||||
* Canvas key-value container.
|
||||
* @type {object}
|
||||
* @private
|
||||
*/
|
||||
this._canvases = {};
|
||||
|
||||
/**
|
||||
* Image key-value container.
|
||||
* @type {object}
|
||||
*/
|
||||
this._images = {};
|
||||
|
||||
/**
|
||||
* Sound key-value container.
|
||||
* @type {object}
|
||||
*/
|
||||
this._sounds = {};
|
||||
|
||||
/**
|
||||
* Text key-value container.
|
||||
* @type {object}
|
||||
*/
|
||||
this._text = {};
|
||||
|
||||
this.addDefaultImage();
|
||||
@@ -23,36 +47,6 @@ Phaser.Cache = function (game) {
|
||||
|
||||
Phaser.Cache.prototype = {
|
||||
|
||||
/**
|
||||
* Local reference to Game.
|
||||
*/
|
||||
game: null,
|
||||
|
||||
/**
|
||||
* Canvas key-value container.
|
||||
* @type {object}
|
||||
* @private
|
||||
*/
|
||||
_canvases: {},
|
||||
|
||||
/**
|
||||
* Image key-value container.
|
||||
* @type {object}
|
||||
*/
|
||||
_images: {},
|
||||
|
||||
/**
|
||||
* Sound key-value container.
|
||||
* @type {object}
|
||||
*/
|
||||
_sounds: {},
|
||||
|
||||
/**
|
||||
* Text key-value container.
|
||||
* @type {object}
|
||||
*/
|
||||
_text: {},
|
||||
|
||||
/**
|
||||
* Add a new canvas.
|
||||
* @param key {string} Asset key for this canvas.
|
||||
|
||||
Reference in New Issue
Block a user