class Background { PImage ground; PImage[] skies; /* PImage clouds; char[] reds = { 0, 0, 44, 31, 48, 31, 24 }; char[] greens = { 153, 153, 132, 71, 67, 31, 24 }; char[] blues = { 204, 153, 160, 86, 82, 31, 24 };*/ Background() { ground = loadImage("ground1.png"); //clouds = loadImage("Backgrounds/clouds.png"); skies = new PImage[7]; String imgName; for(int i=0; i<7; i++) { imgName = "Backgrounds/Sky/Testsky" + (7-i) + ".png"; skies[i] = loadImage(imgName); } } void update() { tint(255, 255); for(int i=-1; i<2; i++) { if(transCount <= 0) { image(skies[stage], i*skies[stage].width - cam%skies[stage].width, 0, skies[stage].width+1, skies[stage].height); } else { image(skies[oldStage], i*skies[oldStage].width - cam%skies[oldStage].width, 0, skies[oldStage].width+1, skies[oldStage].height); tint(255, 255 - transCount*4); image(skies[stage], i*skies[stage].width - cam%skies[stage].width, 0, skies[stage].width+1, skies[stage].height); } } tint(255, 255); for(int i=-1; i<(width/ground.width)+2; i++) { image(ground, i*ground.width - cam%ground.width, height-ground.height, ground.width+1, ground.height); } } }