mirror of
https://github.com/MartinKral/Slash-The-Hordes
synced 2025-10-09 00:26:04 +00:00
Projectiles, angles
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user