Skip to content

Commit

Permalink
use canvas dimensions instead of arbitrary constants to make code mor…
Browse files Browse the repository at this point in the history
…e consistent and its purpose more readable
  • Loading branch information
RandomGamingDev committed Oct 22, 2024
1 parent 983276d commit 01d63b0
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/math/noise.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ let perlin; // will be initialized lazily by noise() or noiseSeed()
* let noiseScale = 0.002;
*
* // Iterate from left to right.
* for (let x = 0; x < 100; x += 1) {
* for (let x = 0; x < width; x += 1) {
* // Scale the input coordinates.
* let nx = noiseScale * x;
* let nt = noiseScale * frameCount;
Expand All @@ -195,9 +195,9 @@ let perlin; // will be initialized lazily by noise() or noiseSeed()
* let noiseScale = 0.01;
*
* // Iterate from top to bottom.
* for (let y = 0; y < 100; y += 1) {
* for (let y = 0; y < height; y += 1) {
* // Iterate from left to right.
* for (let x = 0; x < 100; x += 1) {
* for (let x = 0; x < width; x += 1) {
* // Scale the input coordinates.
* let nx = noiseScale * x;
* let ny = noiseScale * y;
Expand Down Expand Up @@ -230,7 +230,7 @@ let perlin; // will be initialized lazily by noise() or noiseSeed()
* let noiseScale = 0.009;
*
* // Iterate from top to bottom.
* for (let y = 0; y < 100; y += 1) {
* for (let y = 0; y < height; y += 1) {
* // Iterate from left to right.
* for (let x = 0; x < width; x += 1) {
* // Scale the input coordinates.
Expand Down Expand Up @@ -361,9 +361,9 @@ p5.prototype.noise = function(x, y = 0, z = 0) {
* let noiseScale = 0.02;
*
* // Iterate from top to bottom.
* for (let y = 0; y < 100; y += 1) {
* for (let y = 0; y < height; y += 1) {
* // Iterate from left to right.
* for (let x = 0; x < 50; x += 1) {
* for (let x = 0; x < width / 2; x += 1) {
* // Scale the input coordinates.
* let nx = noiseScale * x;
* let ny = noiseScale * y;
Expand Down

0 comments on commit 01d63b0

Please sign in to comment.