Fixed a few things in Circle and added the Point object.

This commit is contained in:
Richard Davey
2013-08-28 15:58:37 +01:00
parent 0f58945212
commit 89fe2855e4
4 changed files with 429 additions and 8 deletions
+12 -1
View File
@@ -94,7 +94,18 @@ Phaser.Circle.prototype = {
* @param {bool} [optional] round Round the distance to the nearest integer (default false)
* @return {Number} The distance between this Point object and the destination Point object.
*/
distance: function () {
distance: function (dest, round) {
if (typeof round === "undefined") { round = false }
if (round)
{
return Phaser.Math.distanceRound(this.x, this.y, dest.x, dest.y);
}
else
{
return Phaser.Math.distance(this.x, this.y, dest.x, dest.y);
}
},