Noise
I mentioned simplex noise briefly in a lecture earlier in the year, but it's basically an improved version of perlin noise. AniGraph imports a library that implements simplex noise which you are welcome to use.
You might use it like this:
let simplexNoise = makeNoise2D();
let scale= 0.1;
let x_feq = 0.3;
let y_freq = 0.3;
...
let x_sample = x*x_freq;
let y_sample = y*y_freq;
let noiseAtXY = simplexNoise(x_sample, y_sample)*scale;
the makeNoise2D function by default will use Math.random to generate randomness. If you wanted to do some kind of infinite world generation you would want to make the randomness based on a consistent seed. You can do this by giving it an instance of the AniGraph SeededRandom class:
let myrandom = new SeededRandom(0);
let simplexNoise = makeNoise2D(myrandom.rand);