diff --git a/sketch.js b/sketch.js index f167b69..7cc2a01 100644 --- a/sketch.js +++ b/sketch.js @@ -5,6 +5,7 @@ var bird; var pipes = []; +var parallax = 0.8; var score = 0; var maxScore = 0; var birdIcon; @@ -30,7 +31,7 @@ function draw() { background(0); // Draw our background image, then move it at the same speed as the pipes image(bgImg, bgX, 0, bgImg.width, height); - bgX -= pipes[0].speed; + bgX -= pipes[0].speed * parallax; // this handles the "infinite loop" by checking if the right // edge of the image would be on the screen, if it is draw a