circleBs: adding circleBs

This commit is contained in:
Sheldan
2025-08-08 22:58:43 +02:00
parent fd799ea724
commit c8cd522c94
10 changed files with 1050 additions and 0 deletions

View File

@@ -121,6 +121,13 @@ export function randomNumberButAtLeast(range, min) {
return (rand < min) ? min : rand;
}
export function randomNumber(n, cur) {
var rand = (Math.random() * n) - n / 2;
if (cur + rand < 0) return 0;
return rand;
}
export function getIndexForCoordinate(config, x, y) {
return (y * config.size.width + x) * 4;
}