> show canvas only <


/* built with Studio Sketchpad: 
 *   https://sketchpad.cc
 * 
 * observe the evolution of this sketch: 
 *   https://dflab.sketchpad.cc/sp/pad/view/ro.kncPIhiOHHm/rev.353
 * 
 * authors: 
 *   Sacruna

 * license (unless otherwise specified): 
 *   creative commons attribution-share alike 3.0 license.
 *   https://creativecommons.org/licenses/by-sa/3.0/ 
 */ 



/* @pjs preload="/static/uploaded_resources/p.10115/Ground.png"; */
/* @pjs preload="/static/uploaded_resources/p.10115/bushes_2.png"; */
/* @pjs preload="/static/uploaded_resources/p.10115/Bushes_1.png"; */
/* @pjs preload="/static/uploaded_resources/p.10115/Background.png"; */
/* @pjs preload="/static/uploaded_resources/p.10115/pimpim.gif"; */

PImage ground = loadImage("/static/uploaded_resources/p.10115/Ground.png");
PImage bushesx = loadImage("/static/uploaded_resources/p.10115/bushes_2.png");
PImage bushes = loadImage("/static/uploaded_resources/p.10115/Bushes_1.png");
PImage sky = loadImage("/static/uploaded_resources/p.10115/Background.png");
PImage pimpim = loadImage("/static/uploaded_resources/p.10115/pimpim.gif");


void setup() {  
    size(800, 600); 
   frameRate (30);

} 
 
float x1 = 0;
float x2 = 0;

float xx1 = 800; 
float xx2 = 800; 
  

float v1 = 5; 
float v2 = 2; 
 
void draw() {
  image (sky);
  
  x1 = x1 - v1;
  x2 = x2 - v2;
  xx1 = xx1 - v1; 
  xx2 = xx2 - v2; 
  
  image (bushesx,x2, 320); 
  image (bushesx, xx2, 320); 
  image (bushes,x1, 416); 
  image (bushes,xx1, 416); 
  image (ground, 0,0);

  if (x1 < -800) {
  x1 = 0;
  }
  if (x2 < -800) {
  x2 = 0;
  }
  if (xx1 < 0) { 
  xx1 = 800;
  }
  if (xx2 < 0) { 
  xx2 = 800;
  }
}