From f1316afebe3a759902119624817fb37c24320b7a Mon Sep 17 00:00:00 2001 From: DaGuT Date: Sat, 10 Mar 2018 12:34:51 +0700 Subject: [PATCH 1/2] added parallax back --- sketch.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sketch.js b/sketch.js index f167b69..44f116a 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 From ea93f97a7fe0bc2656dc9e9e49643a2516f6eedf Mon Sep 17 00:00:00 2001 From: Daniel Shiffman Date: Sat, 10 Mar 2018 11:12:57 -0500 Subject: [PATCH 2/2] enforcing whitespace conventions --- sketch.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sketch.js b/sketch.js index 44f116a..7cc2a01 100644 --- a/sketch.js +++ b/sketch.js @@ -5,7 +5,7 @@ var bird; var pipes = []; -var parallax=0.8; +var parallax = 0.8; var score = 0; var maxScore = 0; var birdIcon; @@ -31,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*parallax; + 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