Skip to content

Commit a044da1

Browse files
committed
Update to use modules
1 parent bc60546 commit a044da1

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

v3/src/components/BaseTransform.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
55
*/
66

7+
var MATH_CONST = require('../math/const');
8+
var WrapAngle = require('../math/angle/Wrap');
9+
var Transform = require('./Transform');
10+
711
/**
812
* A BaseTransform class that you can use when extending Game Objects.
913
* Hides away the 'private' stuff and exposes only the useful getters and setters
@@ -12,7 +16,7 @@
1216
*/
1317
var BaseTransform = function (x, y)
1418
{
15-
this.transform = new Phaser.Component.Transform(this, x, y);
19+
this.transform = new Transform(this, x, y);
1620
};
1721

1822
BaseTransform.prototype.constructor = BaseTransform;
@@ -199,12 +203,12 @@ Object.defineProperties(BaseTransform.prototype, {
199203

200204
get: function ()
201205
{
202-
return Phaser.Math.wrapAngle(this.rotation * Phaser.Math.RAD_TO_DEG);
206+
return WrapAngle(this.rotation * MATH_CONST.RAD_TO_DEG);
203207
},
204208

205209
set: function (value)
206210
{
207-
this.rotation = Phaser.Math.wrapAngle(value) * Phaser.Math.DEG_TO_RAD;
211+
this.rotation = WrapAngle(value) * MATH_CONST.DEG_TO_RAD;
208212
}
209213

210214
},
@@ -228,7 +232,7 @@ Object.defineProperties(BaseTransform.prototype, {
228232
this.transform._rotation = value;
229233
this.transform.dirty = true;
230234

231-
if (this.transform._rotation % Phaser.Math.PI2)
235+
if (this.transform._rotation % MATH_CONST.PI2)
232236
{
233237
this.transform.cache.sr = Math.sin(this.transform._rotation);
234238
this.transform.cache.cr = Math.cos(this.transform._rotation);

0 commit comments

Comments
 (0)