move random functions to rng class, fix some imports

This commit is contained in:
Zutatensuppe 2021-05-17 01:12:39 +02:00
parent 07c08019f5
commit 432e1b6668
16 changed files with 71 additions and 80 deletions

View file

@ -20,10 +20,10 @@ const explosionDividerFactor = 10
const nBombs = 1
const percentChanceNewBomb = 5
function color(rng: Rng) {
const r = Util.randomInt(rng, 0, 255)
const g = Util.randomInt(rng, 0, 255)
const b = Util.randomInt(rng, 0, 255)
function color(rng: Rng): string {
const r = rng.random(0, 255)
const g = rng.random(0, 255)
const b = rng.random(0, 255)
return 'rgba(' + r + ',' + g + ',' + b + ', 0.8)'
}