String bgURL = "https://img.freepik.com/free-photo/old-wooden-texture-background-vintage_55716-1138.jpg?size=626&ext=jpg";
PImage bg;
String bg1URL = "https://mcdonalds.co.nz/sites/mcdonalds.co.nz/files/BigMac_BB_Low_XXXX_2019_SMP%20700x487.png";
PImage bg1;
String bg2URL = "https://www.serebii.net/swordshield/pokemon/446.png";
PImage bg2;
String bg3URL = "https://images.gameinfo.io/pokemon/256/143-00.png";
PImage bg3;
String bg4URL = "https://vignette.wikia.nocookie.net/supermarioglitchy4/images/f/f3/Big_chungus.png/revision/latest/top-crop/width/360/height/450?cb=20200511041102";
PImage bg4;
String bg5URL = "https://vignette.wikia.nocookie.net/villainsfanon/images/0/08/3DUgandanKnuckles.png/revision/latest?cb=20180129185913";
PImage bg5;
String bg6URL = "https://admin.client-uat.localsearchprofiles.com/Public/PublishedMedia/Images/ba7c4982-a405-4ddb-8741-4405000272a8.png?c=636843533949732040=";
PImage bg6;
String bg7URL = "https://fiverr-res.cloudinary.com/images/q_auto,f_auto/gigs/136138720/original/5a72f22d195f0c52bce91cbd9d9bdd28bfae9db6/draw-emotes-scuffed-or-write-something-in-a-fancy-handwriting.jpg";
PImage bg7;
String bg8URL = "https://vignette.wikia.nocookie.net/sugoi-quest-for-kokoro/images/5/51/Doctor_chan.png/revision/latest/scale-to-width-down/340?cb=20160709035854";
PImage bg8;
String bg9URL = "https://s3.amazonaws.com/ymca-ynet-prod/files/seo/ymca-logo-orange.png";
PImage bg9;
int score = 0;
int price = 100;
int price2 = 500;
int price3 = 1000;
int price4 = 5000;
int price5 = 500;
int price6 = 1500;
int price7 = 3000;
int price8 = 5000;
float CPS = 0;
float perclick = 1;
void setup(){
size(1000,600);
bg = loadImage(bgURL);
bg1 = loadImage(bg1URL);
bg2 = loadImage(bg2URL);
bg3 = loadImage(bg3URL);
bg4 = loadImage(bg4URL);
bg5 = loadImage(bg5URL);
bg6 = loadImage(bg6URL);
bg7 = loadImage(bg7URL);
bg8 = loadImage(bg8URL);
bg9 = loadImage(bg9URL);
imageMode(CENTER);
textAlign(CENTER,CENTER);
}
void draw(){
image(bg,500,300,1000,600);
image(bg1,150,300,300,200);
image(bg2,850,50,100,100);
image(bg3,850,190,150,150);
image(bg4,850,350,130,130);
image(bg5,850,500,130,130);
image(bg6,540,50,130,120);
image(bg7,540,200,130,120);
image(bg8,540,350,130,150);
image(bg9,540,530,130,100);
score += CPS/60;
textSize (60);
text (score,150,150);
textSize (30);
text (price,730,80);
textSize (30);
text (price2,730,230);
textSize (30);
text (price3,730,390);
textSize (30);
text (price4,730,560);
textSize (30);
text (price5,400,80);
textSize (30);
text (price6,400,230);
textSize (30);
text (price7,400,390);
textSize (30);
text (price8,400,560);
}
void mousePressed(){
if(isTouching(150,300,300,200, mouseX,mouseY,1,1)){
score += perclick;
}
if(isTouching(850,50,100,100, mouseX,mouseY,1,1)){
if (score >= 100)
score -= 100;
CPS += 1;
}
if(isTouching(850,190,150,150, mouseX,mouseY,1,1)){
if (score >= 500)
score -= 500;
CPS += 5;
}
if(isTouching(850,350,130,130, mouseX,mouseY,1,1)){
if (score >= 1000)
score -= 1000;
CPS += 10;
}
if(isTouching(850,500,130,130, mouseX,mouseY,1,1)){
if (score >= 5000)
score -= 5000;
CPS += 50;
}
if(isTouching(540,50,130,120, mouseX,mouseY,1,1)){
if (score >= 500)
score -= 500;
perclick += 5;
}
if(isTouching(540,200,130,120, mouseX,mouseY,1,1)){
if (score >= 1500)
score -= 1500;
perclick += 10;
}
if(isTouching(540,350,130,150, mouseX,mouseY,1,1)){
if (score >= 3000)
score -= 3000;
perclick += 100;
}
if(isTouching(540,530,130,100, mouseX,mouseY,1,1)){
if (score >= 5000)
score -= 5000;
perclick += 500;
}
}
void mouseReleased(){
if(isTouching(150,300,300,200, mouseX,mouseY,1,1)){
}
}
boolean isTouching(float x1, float y1, float w1, float h1, float x2, float y2, float w2, float h2){
return abs(x1-x2)<(w1+w2)/2 && abs(y1-y2)<(h1+h2)/2;
}