New games every week!
Randomisation, Kinda.. Blog
20th July 2019
I spent last night rewriting my Pseudo Random code so that it works nicely in Javascript, for both Browsercade and Shoebox.

-=-=-

The point of a Pseudo Random function is that you can easily reproduce the results on a set of "random" numbers.
I couldn't find a way to get Javascript to do it in a reproducible way, on all different browsers, so instead I opted to write my own. Or, rather, copy and paste my old version and tweak it to work, here!

The purpose for using "seedable" numbers is so that I can generate a set of numbers that are usually the same each time. This is useful for things like Level Generators. Give the generator the same seed, and you should end up with the same level.

In theory!
I've not stress tested the random function on all browsers, so will have to do that at some point, today. I'm expecting a couple of issues, given that it relies on a large text string, which appears to be getting mangled by Edge.. Hmmm.
Views 31, Upvotes 3  
Daily Blog
New games every week!
Site credits : Jayenkai made this.
(c) Jayenkai 2023 and onwards, RSS feed

Blog - Randomisation, Kinda.. - AGameAWeek