[pongwars] initial random angled speed

This commit is contained in:
dogeystamp 2024-02-17 19:48:16 -05:00
parent fba38f982c
commit 22384d28aa
Signed by: dogeystamp
GPG Key ID: 7225FE3592EFFA38

View File

@ -231,8 +231,9 @@
}
for (let i = 0; i < teams.length; i++) {
teams[i].dx = 5 * randInt(-1, 1);
teams[i].dy = 5;
const angle = randomNum(0, 2 * Math.PI);
teams[i].dx = 5 * Math.cos(angle);
teams[i].dy = 5 * Math.sin(angle);
}
}