mirror of
https://github.com/wassname/phaser.git
synced 2026-08-20 12:40:12 +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:
+15
-9
@@ -11,28 +11,34 @@
|
||||
**/
|
||||
Phaser.Circle = function (x, y, diameter) {
|
||||
|
||||
if (typeof x === "undefined") { x = 0; }
|
||||
if (typeof y === "undefined") { y = 0; }
|
||||
if (typeof diameter === "undefined") { diameter = 0; }
|
||||
|
||||
this._diameter = 0;
|
||||
this._radius = 0;
|
||||
x = x || 0;
|
||||
y = y || 0;
|
||||
diameter = diameter || 0;
|
||||
|
||||
/**
|
||||
* The x coordinate of the center of the circle
|
||||
* @property x
|
||||
* @type Number
|
||||
**/
|
||||
this.x = 0;
|
||||
this.x = x;
|
||||
|
||||
/**
|
||||
* The y coordinate of the center of the circle
|
||||
* @property y
|
||||
* @type Number
|
||||
**/
|
||||
this.y = 0;
|
||||
this.y = y;
|
||||
|
||||
this.setTo(x, y, diameter);
|
||||
this._diameter = diameter;
|
||||
|
||||
if (diameter > 0)
|
||||
{
|
||||
this._radius = diameter * 0.5;
|
||||
}
|
||||
else
|
||||
{
|
||||
this._radius = 0;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
|
||||
+2
-2
@@ -18,8 +18,8 @@
|
||||
**/
|
||||
Phaser.Point = function (x, y) {
|
||||
|
||||
if (typeof x === "undefined") { x = 0; }
|
||||
if (typeof y === "undefined") { y = 0; }
|
||||
x = x || 0;
|
||||
y = y || 0;
|
||||
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
|
||||
@@ -48,34 +48,6 @@ Phaser.Rectangle = function (x, y, width, height) {
|
||||
|
||||
Phaser.Rectangle.prototype = {
|
||||
|
||||
/**
|
||||
* @property x
|
||||
* @type Number
|
||||
* @default 0
|
||||
*/
|
||||
x: 0,
|
||||
|
||||
/**
|
||||
* @property y
|
||||
* @type Number
|
||||
* @default 0
|
||||
*/
|
||||
y: 0,
|
||||
|
||||
/**
|
||||
* @property width
|
||||
* @type Number
|
||||
* @default 0
|
||||
*/
|
||||
width: 0,
|
||||
|
||||
/**
|
||||
* @property height
|
||||
* @type Number
|
||||
* @default 0
|
||||
*/
|
||||
height: 0,
|
||||
|
||||
/**
|
||||
* Adjusts the location of the Rectangle object, as determined by its top-left corner, by the specified amounts.
|
||||
* @method offset
|
||||
|
||||
Reference in New Issue
Block a user