Added parallax to mountains

This commit is contained in:
Mottributo 2023-03-23 16:35:28 +03:00
parent 8eab7faf27
commit 899dc410dc

View File

@ -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) {