mirror of
https://github.com/wassname/phaser.git
synced 2026-08-15 12:45:11 +08:00
Tidying up source code for release. Also refactored World to use a Group instance, rather tha duplicate functions.
This commit is contained in:
@@ -168,10 +168,7 @@ Object.defineProperty(Phaser.Animation.prototype, "frameTotal", {
|
||||
|
||||
get: function () {
|
||||
return this._frames.length;
|
||||
},
|
||||
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
@@ -200,9 +197,6 @@ Object.defineProperty(Phaser.Animation.prototype, "frame", {
|
||||
this._parent.setTexture(PIXI.TextureCache[this.currentFrame.uuid]);
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
@@ -217,10 +217,8 @@ Object.defineProperty(Phaser.AnimationManager.prototype, "frameData", {
|
||||
|
||||
get: function () {
|
||||
return this._frameData;
|
||||
},
|
||||
}
|
||||
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
|
||||
Object.defineProperty(Phaser.AnimationManager.prototype, "frameTotal", {
|
||||
@@ -235,10 +233,8 @@ Object.defineProperty(Phaser.AnimationManager.prototype, "frameTotal", {
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
|
||||
Object.defineProperty(Phaser.AnimationManager.prototype, "frame", {
|
||||
@@ -266,10 +262,8 @@ Object.defineProperty(Phaser.AnimationManager.prototype, "frame", {
|
||||
this.sprite.setTexture(PIXI.TextureCache[this.currentFrame.uuid]);
|
||||
}
|
||||
|
||||
},
|
||||
}
|
||||
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
|
||||
Object.defineProperty(Phaser.AnimationManager.prototype, "frameName", {
|
||||
@@ -296,8 +290,6 @@ Object.defineProperty(Phaser.AnimationManager.prototype, "frameName", {
|
||||
{
|
||||
console.warn("Cannot set frameName: " + value);
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
|
||||
+14
-10
@@ -92,6 +92,7 @@ Phaser.Animation.FrameData.prototype = {
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -105,7 +106,8 @@ Phaser.Animation.FrameData.prototype = {
|
||||
|
||||
if (typeof output === "undefined") { output = []; }
|
||||
|
||||
for (var i = start; i <= end; i++) {
|
||||
for (var i = start; i <= end; i++)
|
||||
{
|
||||
output.push(this._frames[i]);
|
||||
}
|
||||
|
||||
@@ -122,7 +124,8 @@ Phaser.Animation.FrameData.prototype = {
|
||||
|
||||
if (typeof output === "undefined") { output = []; }
|
||||
|
||||
for (var i = 0; i < this._frames.length; i++) {
|
||||
for (var i = 0; i < this._frames.length; i++)
|
||||
{
|
||||
output.push(i);
|
||||
}
|
||||
|
||||
@@ -139,12 +142,12 @@ Phaser.Animation.FrameData.prototype = {
|
||||
|
||||
var output = [];
|
||||
|
||||
for (var i = 0; i < input.length; i++) {
|
||||
|
||||
if (this.getFrameByName(input[i])) {
|
||||
for (var i = 0; i < input.length; i++)
|
||||
{
|
||||
if (this.getFrameByName(input[i]))
|
||||
{
|
||||
output.push(this.getFrameByName(input[i]).index);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return output;
|
||||
@@ -168,7 +171,8 @@ Phaser.Animation.FrameData.prototype = {
|
||||
|
||||
var output = [];
|
||||
|
||||
for (var i = 0; i < range.length; i++) {
|
||||
for (var i = 0; i < range.length; i++)
|
||||
{
|
||||
output.push(this._frames[i]);
|
||||
}
|
||||
|
||||
@@ -178,10 +182,10 @@ Phaser.Animation.FrameData.prototype = {
|
||||
};
|
||||
|
||||
Object.defineProperty(Phaser.Animation.FrameData.prototype, "total", {
|
||||
|
||||
get: function () {
|
||||
return this._frames.length;
|
||||
},
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user