Advertisement
ThatOnePandaGuy

Untitled

Aug 5th, 2017
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 3.36 KB | None | 0 0
  1. //Timers//
  2.   int m = 0;
  3.   int p = 0;
  4.   int l = 0;
  5.   int f = 0;
  6.   int pg = 0;
  7. //Menues//
  8.   int a = 0;
  9. int points = 0;
  10. //Minion
  11.   int pM = 100;//Price
  12.   int aM = 0;//Amount
  13. //Peasant
  14.   int pP = 500;//Price
  15.   int aP = 0;//Amount
  16.   int Pp = 0;//Points
  17. //Loyal Servant
  18.   int pL = 10000;//Price
  19.   int aL = 0;//Amount
  20.   int Pl = 0;//Points
  21. //Factory Worker
  22.   int pF = 100000;//Price
  23.   int aF = 0;//Amount
  24.   int Pf = 0;//Points
  25. //Point Generator
  26.   int pG = 500000;
  27.   int aG = 0;
  28.   int Pg = 0;
  29.   PImage coin;
  30.  
  31. void setup() {
  32.   size(600, 600);
  33.   coin = loadImage("coin.png");
  34. }
  35.  
  36. void draw() {
  37.   if (a == 0) {//Start menu
  38.     drawMenu();
  39.   } else if (a==1) {//Game menu
  40.     drawGameMenu();
  41.   } else if (a == 2) {
  42.     drawMoreItems();
  43.   } else if (a == 3) {
  44.     drawInfo();
  45.   }
  46.    //////////MINION/1////////
  47.       m++;
  48.       if (m>50) {
  49.         points= aM+points;
  50.         m = 0;
  51.       }
  52.    //////////Pesant/2/////////
  53.       p++;
  54.       if (p>100) {
  55.         points= Pp+points;
  56.         p = 0;
  57.       }
  58.    //////LOYAL SERVERNT/5///
  59.       l++;
  60.       if (l>250) {
  61.         points= Pl+points;
  62.         l=0;
  63.       }
  64.    /////Factory Worker/10///
  65.       f++;
  66.       if (f>500) {
  67.         points=Pf+points;
  68.         f =0;
  69.       }
  70.    ///Points Generator/20//
  71.      pg++;
  72.      if (pg>1000) {
  73.        points=Pg+points;
  74.        pg =0;
  75.      }
  76. }
  77.  
  78. void mousePressed() {
  79.   /////////////////////////////Start Menu/////////////////////////////
  80.   if (a == 0) {
  81.     if(mouseX >160 && mouseX<410 && mouseY>150 && mouseY<250) {
  82.     a = 1;
  83.     }
  84.   ///Info///
  85.     if(mouseX >160 && mouseX<410 && mouseY>270 && mouseY<370) {
  86.     a = 3;
  87.     }
  88.   }
  89.   ///Info Back///
  90.   if (a == 3) {
  91.     if(mouseX >170 && mouseX<400 && mouseY>400 && mouseY<490) {
  92.       a = 0;
  93.     }
  94.   }
  95.   /////////////////////////////Game Menu//////////////////////////////
  96.   if (a == 1) {
  97.     if(mouseX >40 && mouseX<140 && mouseY>250 && mouseY<350) {
  98.       points = points+1;
  99.     }
  100.   ///More Items///
  101.     if(mouseX >250 && mouseX<480 && mouseY>400 && mouseY<500) {
  102.       a = 2;
  103.     }
  104.   //////////////////////////////////////////MINION/////////////////////////////////////
  105.     if(mouseX >250 && mouseX<480 && mouseY>70 && mouseY<170 && points >= pM) {
  106.       pM = pM+10;
  107.       aM = aM+1;
  108.       points = points-pM+10;
  109.       println("Minion");
  110.     }
  111.   //////////////////////////////////////PEASANT////////////////////////////////////////
  112.     if(mouseX >250 && mouseX<480 && mouseY>180 && mouseY<280 && points >= pP) {
  113.       pP = pP+25;
  114.       Pp = Pp+25;
  115.       aP = aP+1;
  116.       points = points-pP+25;
  117.       println("Pesant");
  118.     }
  119.   ///////////////////////////////////LOAYL SERVANT/////////////////////////////////////
  120.     if(mouseX >250 && mouseX<480 && mouseY>190 && mouseY<390 && points >= pL) {
  121.       pL = pL+1000;
  122.       Pl = Pl+45;
  123.       aL = aL+1;
  124.       points = points-pL+1000;
  125.       println("Loayl Servant");
  126.     }
  127.   }
  128.   ///Back to menu 1///
  129.     if (a == 2) {
  130.     if(mouseX >190 && mouseX<420 && mouseY>450 && mouseY<550) {
  131.       a = 1;
  132.     }
  133.   ///////////////////////////////////Factory Worker/////////////////////////////////////
  134.     if(mouseX >40 && mouseX<270 && mouseY>100 && mouseY<190 && points >= pF) {
  135.       pF = pF+10000;
  136.       Pf = Pf+100;
  137.       aF = aF+1;
  138.       points = points-pF+10000;
  139.       println("Loayl Servant");
  140.     }
  141.   }
  142.   //println(mouseX,mouseY);
  143.  }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement