🤑 Indie game store🙌 Free games😂 Fun games😨 Horror games
👷 Game development🎨 Assets📚 Comics
🎉 Sales🎁 Bundles

Uncaught ReferenceError: RNG is not defined

A topic by ATPA9 created Jan 08, 2016 Views: 618 Replies: 3
Viewing posts 1 to 4

I tried to make a random number, but I get that error.


var ran = new RNG('w');



Is there something wrong with my code


Hi ! If you just want to pick an random number, you should use:

let number = Sup.Math.Random.integer(min, max) - For an integer


let number = Sup.Math.Random.float(min, max) - For an decimal number

I hope I helped you :)


Thanks for helping me so quickly:D

you helped me a lot


For info - There is a problem with the 0.19.0 release which broke RNG class. Yvanor's tip fixes it for now, but for future randomization RNG is the way to go, Math.Random doesn't support seeding so it becomes very difficult to find bugs with randomized behavior. The fix was commit on Jan 15 Github 589a6d9