moveTo parameter working if layer is found

This commit is contained in:
Hanusiak Piotr 2022-01-20 15:10:54 +01:00
parent cb0c5beecf
commit e87c0a07a4
4 changed files with 57 additions and 8 deletions

View file

@ -31,4 +31,8 @@ export class MathUtils {
const distance = Math.pow(p1.x - p2.x, 2) + Math.pow(p1.y - p2.y, 2);
return squared ? Math.sqrt(distance) : distance;
}
public static randomFromArray<T>(array: T[]): T {
return array[Math.floor(Math.random() * array.length)];
}
}