MCPcopy Create free account
hub / github.com/Vishal-raj-1/Awesome-JavaScript-Projects / noise

Function noise

assets/js/Motorcycle.js:14–17  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

12
13var lerp = (a, b, t) => a + (b - a) * (1 - Math.cos(t * Math.PI)) / 2;
14var noise = x => {
15 x = x * 0.01 % 255;
16 return lerp(perm[Math.floor(x)], perm[Math.ceil(x)], x - Math.floor(x));
17}
18
19var player = new function () {
20 this.x = c.width / 2;

Callers 2

Motorcycle.jsFile · 0.85
loopFunction · 0.85

Calls 1

lerpFunction · 0.70

Tested by

no test coverage detected