mirror of
https://github.com/wassname/phaser.git
synced 2026-09-09 11:28:47 +08:00
Fixed a few things in Circle and added the Point object.
This commit is contained in:
+12
-1
@@ -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);
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user