This commit is contained in:
David Négrier 2020-07-23 18:47:28 +02:00
parent 2484e4f1df
commit d48d5b0285
5 changed files with 16 additions and 15 deletions

View file

@ -18,7 +18,7 @@ export class ActionableItem {
* OR null if we are out of range.
*/
public actionableDistance(x: number, y: number): number|null {
let distanceSquared = (x - this.sprite.x)*(x - this.sprite.x) + (y - this.sprite.y)*(y - this.sprite.y);
const distanceSquared = (x - this.sprite.x)*(x - this.sprite.x) + (y - this.sprite.y)*(y - this.sprite.y);
if (distanceSquared < this.activationRadiusSquared) {
return distanceSquared;
} else {