Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Timers//
- int m = 0;
- int p = 0;
- int l = 0;
- int f = 0;
- int pg = 0;
- //Menues//
- int a = 0;
- int points = 0;
- //Minion
- int pM = 100;//Price
- int aM = 0;//Amount
- //Peasant
- int pP = 500;//Price
- int aP = 0;//Amount
- int Pp = 0;//Points
- //Loyal Servant
- int pL = 10000;//Price
- int aL = 0;//Amount
- int Pl = 0;//Points
- //Factory Worker
- int pF = 100000;//Price
- int aF = 0;//Amount
- int Pf = 0;//Points
- //Point Generator
- int pG = 500000;
- int aG = 0;
- int Pg = 0;
- PImage coin;
- void setup() {
- size(600, 600);
- coin = loadImage("coin.png");
- }
- void draw() {
- if (a == 0) {//Start menu
- drawMenu();
- } else if (a==1) {//Game menu
- drawGameMenu();
- } else if (a == 2) {
- drawMoreItems();
- } else if (a == 3) {
- drawInfo();
- }
- //////////MINION/1////////
- m++;
- if (m>50) {
- points= aM+points;
- m = 0;
- }
- //////////Pesant/2/////////
- p++;
- if (p>100) {
- points= Pp+points;
- p = 0;
- }
- //////LOYAL SERVERNT/5///
- l++;
- if (l>250) {
- points= Pl+points;
- l=0;
- }
- /////Factory Worker/10///
- f++;
- if (f>500) {
- points=Pf+points;
- f =0;
- }
- ///Points Generator/20//
- pg++;
- if (pg>1000) {
- points=Pg+points;
- pg =0;
- }
- }
- void mousePressed() {
- /////////////////////////////Start Menu/////////////////////////////
- if (a == 0) {
- if(mouseX >160 && mouseX<410 && mouseY>150 && mouseY<250) {
- a = 1;
- }
- ///Info///
- if(mouseX >160 && mouseX<410 && mouseY>270 && mouseY<370) {
- a = 3;
- }
- }
- ///Info Back///
- if (a == 3) {
- if(mouseX >170 && mouseX<400 && mouseY>400 && mouseY<490) {
- a = 0;
- }
- }
- /////////////////////////////Game Menu//////////////////////////////
- if (a == 1) {
- if(mouseX >40 && mouseX<140 && mouseY>250 && mouseY<350) {
- points = points+1;
- }
- ///More Items///
- if(mouseX >250 && mouseX<480 && mouseY>400 && mouseY<500) {
- a = 2;
- }
- //////////////////////////////////////////MINION/////////////////////////////////////
- if(mouseX >250 && mouseX<480 && mouseY>70 && mouseY<170 && points >= pM) {
- pM = pM+10;
- aM = aM+1;
- points = points-pM+10;
- println("Minion");
- }
- //////////////////////////////////////PEASANT////////////////////////////////////////
- if(mouseX >250 && mouseX<480 && mouseY>180 && mouseY<280 && points >= pP) {
- pP = pP+25;
- Pp = Pp+25;
- aP = aP+1;
- points = points-pP+25;
- println("Pesant");
- }
- ///////////////////////////////////LOAYL SERVANT/////////////////////////////////////
- if(mouseX >250 && mouseX<480 && mouseY>190 && mouseY<390 && points >= pL) {
- pL = pL+1000;
- Pl = Pl+45;
- aL = aL+1;
- points = points-pL+1000;
- println("Loayl Servant");
- }
- }
- ///Back to menu 1///
- if (a == 2) {
- if(mouseX >190 && mouseX<420 && mouseY>450 && mouseY<550) {
- a = 1;
- }
- ///////////////////////////////////Factory Worker/////////////////////////////////////
- if(mouseX >40 && mouseX<270 && mouseY>100 && mouseY<190 && points >= pF) {
- pF = pF+10000;
- Pf = Pf+100;
- aF = aF+1;
- points = points-pF+10000;
- println("Loayl Servant");
- }
- }
- //println(mouseX,mouseY);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement