diff --git a/sketch.js b/sketch.js index 0022e40..1562ccd 100644 --- a/sketch.js +++ b/sketch.js @@ -608,8 +608,10 @@ function drawClouds() { } function drawMountains() { for (i = 0; i < mountains.length; i++) { + push(); + // slowing down translation to add parallax, the feeling of depth + translate(cameraPosX/8, 0); noStroke(); - fill(palette.mountain_shadow); triangle( mountains[i].x - mountains[i].width, @@ -628,6 +630,7 @@ function drawMountains() { mountains[i].x - mountains[i].width / 1.5, floorPos_y ); + pop(); } } function drawHeart(isEmpty, x, y, size) {