This demo demonstrate how to use the built-in perlin noise generator. Press Space to randomize noise.
The following is a code example on how to load a binary assets.
// generate array with perlin noise for a 100x100 matrix, using seed '123'
const seed = 123;
let perlin = new Shaku.utils.Perlin(seed);
let noise = [];
for (let x = 0; x < 100; ++x) {
for (let y = 0; y < 100; ++y) {
let val = perlin.generateSmooth(x / 25, y / 25, 0.15);
noise.push(val);
}
}