move random functions to rng class, fix some imports
This commit is contained in:
parent
07c08019f5
commit
432e1b6668
16 changed files with 71 additions and 80 deletions
|
|
@ -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)'
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue