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:
Richard Davey
2013-09-10 20:40:34 +01:00
parent a486bf6b4a
commit e41e35fd09
23 changed files with 533 additions and 558 deletions
+18 -17
View File
@@ -10,26 +10,23 @@
*/
Phaser.Animation.FrameData = function () {
/**
* Local frame container.
* @type {Phaser.Frame[]}
* @private
*/
this._frames = [];
/**
* Local frameName<->index container.
* @private
*/
this._frameNames = [];
};
Phaser.Animation.FrameData.prototype = {
/**
* Local frame container.
* @type {Phaser.Frame[]}
* @private
*/
_frames: [],
/**
* Local frameName<->index container.
* @private
*/
_frameNames: [],
/**
* Add a new frame.
* @param frame {Frame} The frame you want to add.
@@ -41,7 +38,8 @@ Phaser.Animation.FrameData.prototype = {
this._frames.push(frame);
if (frame.name !== '') {
if (frame.name !== '')
{
this._frameNames[frame.name] = frame.index;
}
@@ -56,7 +54,8 @@ Phaser.Animation.FrameData.prototype = {
*/
getFrame: function (index) {
if (this._frames[index]) {
if (this._frames[index])
{
return this._frames[index];
}
@@ -71,7 +70,8 @@ Phaser.Animation.FrameData.prototype = {
*/
getFrameByName: function (name) {
if (this._frameNames[name] !== '') {
if (this._frameNames[name] !== '')
{
return this._frames[this._frameNames[name]];
}
@@ -86,7 +86,8 @@ Phaser.Animation.FrameData.prototype = {
*/
checkFrameName: function (name) {
if (this._frameNames[name] == null) {
if (this._frameNames[name] == null)
{
return false;
}