Skip to content

Commit

Permalink
Merge pull request #32 from DaGuT/parallax2
Browse files Browse the repository at this point in the history
added parallax back
  • Loading branch information
shiffman authored Mar 10, 2018
2 parents 84d6e95 + ea93f97 commit a085c5e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion sketch.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

var bird;
var pipes = [];
var parallax = 0.8;
var score = 0;
var maxScore = 0;
var birdIcon;
Expand All @@ -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
Expand Down

0 comments on commit a085c5e

Please sign in to comment.