phaser/Plugins/IPlugin.js

23 lines
556 B
JavaScript
Raw Normal View History

// Module
var Shapes;
(function (Shapes) {
// Class
var Point = (function () {
// Constructor
function Point(x, y) {
this.x = x;
this.y = y;
}
Point.prototype.getDist = // Instance member
function () {
return Math.sqrt(this.x * this.x + this.y * this.y);
};
Point.origin = new Point(0, 0);
return Point;
})();
Shapes.Point = Point;
})(Shapes || (Shapes = {}));
// Local variables
var p = new Shapes.Point(3, 4);
var dist = p.getDist();