From a813bbb8045bd1883770589d2442c9f8c41eeccb Mon Sep 17 00:00:00 2001 From: Mottributo <87079566+Mottributo@users.noreply.github.com> Date: Thu, 23 Mar 2023 16:39:49 +0300 Subject: [PATCH] Added clouds parallax --- sketch.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sketch.js b/sketch.js index 1562ccd..7c2eadf 100644 --- a/sketch.js +++ b/sketch.js @@ -575,6 +575,9 @@ function drawClouds() { for (i = 0; i < clouds.length; i++) { push(); translate((frameCount / clouds[i].y) * 20, 0); // imitating clouds movement, upper ones should go faster + // Adding counter-translating to implement parallax, the feeling of depth + // TODO: fix jitter during movement (possibly by implementing vectorized movement) + translate(cameraPosX/1.1, 0); noStroke(); fill(palette.cloud0); ellipse(