Advertisement
Guest User

Untitled

a guest
Apr 21st, 2019
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.50 KB | None | 0 0
  1. String jackpot = "JACKPOT" ;
  2. color clrJackpot = color(211, 0, 184);
  3. PFont fontBerlin;
  4.  
  5. PImage imgIcons, imgFruits, imgCandies;
  6. int numIcon = 5;
  7. int numFruit = 6;
  8. int numCandy = 6;
  9. PImage[] IconSet = new PImage[numIcon];
  10. PImage[] FruitSet = new PImage[numFruit];
  11. PImage[] CandySet = new PImage[numCandy];
  12.  
  13. int numOfGames = 3;
  14. Jackpot[] jpGames = new Jackpot[numOfGames];
  15.  
  16. void setup() {
  17. size(600, 750);
  18. fontBerlin = loadFont("BerlinSansFBDemi-Bold-100.vlw");
  19. imgIcons = loadImage("icons.jpg");
  20. imgFruits = loadImage("fruits.jpg");
  21. imgCandies = loadImage("candy.jpg");
  22. saveArrImage();
  23.  
  24. jpGames[0] = new Jackpot(IconSet, 70, 100);
  25. jpGames[1] = new Jackpot(FruitSet, 70, 300);
  26. jpGames[2] = new Jackpot(CandySet, 70, 500);
  27. }
  28.  
  29. void draw() {
  30. background(0);
  31. textFont(fontBerlin, 60);
  32. textAlign(CENTER);
  33. fill(clrJackpot);
  34. text(jackpot, width/2, 70);
  35.  
  36. for (int i =0; i < jpGames.length; i++) {
  37. jpGames[i].genNumbers();
  38. jpGames[i].display();
  39. }
  40.  
  41. noLoop();
  42. }
  43.  
  44. void saveArrImage() {
  45. for (int i =0; i < IconSet.length; i++) {
  46. IconSet[i] = imgIcons.get(imgIcons.width/numIcon*i, 0, imgIcons.width/numIcon, imgIcons.height);
  47. }
  48. for (int i =0; i < FruitSet.length; i++) {
  49. FruitSet[i] = imgFruits.get(imgFruits.width/numFruit*i, 0, imgFruits.width/numFruit, imgFruits.height);
  50. }
  51. for (int i =0; i < CandySet.length; i++) {
  52. CandySet[i] = imgCandies.get(imgCandies.width/numCandy*i, 0, imgCandies.width/numCandy, imgCandies.height);
  53. }
  54. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement