multiBalls refactoring with ballsArr[]

This commit is contained in:
LuckyLaszlo
2022-12-01 17:48:34 +01:00
parent c8c3111ed4
commit f73932c131
9 changed files with 97 additions and 121 deletions

View File

@@ -7,4 +7,13 @@ function sleep (ms: number) {
return new Promise((resolve) => setTimeout(resolve, ms));
}
export {random, sleep}
function clamp(n: number, min: number, max: number) : number
{
if (n < min)
n = min;
else if (n > max)
n = max;
return (n);
}
export {random, sleep, clamp}