Projectiles, angles

This commit is contained in:
Martin
2022-12-15 11:14:35 +01:00
parent d989ead748
commit 9c3299ebfe
15 changed files with 2779 additions and 1870 deletions

View File

@@ -5,3 +5,8 @@ export function roundToOneDecimal(num: number): number {
export function randomPositiveOrNegative(): number {
return Math.random() < 0.5 ? 1 : -1;
}
export function getDegreeAngleFromDirection(x: number, y: number): number {
const radianAngle = Math.atan2(y, x);
return (radianAngle / Math.PI) * 180;
}