Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- String jackpot = "JACKPOT" ;
- color clrJackpot = color(211, 0, 184);
- PFont fontBerlin;
- PImage imgIcons, imgFruits, imgCandies;
- int numIcon = 5;
- int numFruit = 6;
- int numCandy = 6;
- PImage[] IconSet = new PImage[numIcon];
- PImage[] FruitSet = new PImage[numFruit];
- PImage[] CandySet = new PImage[numCandy];
- int numOfGames = 3;
- Jackpot[] jpGames = new Jackpot[numOfGames];
- void setup() {
- size(600, 750);
- fontBerlin = loadFont("BerlinSansFBDemi-Bold-100.vlw");
- imgIcons = loadImage("icons.jpg");
- imgFruits = loadImage("fruits.jpg");
- imgCandies = loadImage("candy.jpg");
- saveArrImage();
- jpGames[0] = new Jackpot(IconSet, 70, 100);
- jpGames[1] = new Jackpot(FruitSet, 70, 300);
- jpGames[2] = new Jackpot(CandySet, 70, 500);
- }
- void draw() {
- background(0);
- textFont(fontBerlin, 60);
- textAlign(CENTER);
- fill(clrJackpot);
- text(jackpot, width/2, 70);
- for (int i =0; i < jpGames.length; i++) {
- jpGames[i].genNumbers();
- jpGames[i].display();
- }
- noLoop();
- }
- void saveArrImage() {
- for (int i =0; i < IconSet.length; i++) {
- IconSet[i] = imgIcons.get(imgIcons.width/numIcon*i, 0, imgIcons.width/numIcon, imgIcons.height);
- }
- for (int i =0; i < FruitSet.length; i++) {
- FruitSet[i] = imgFruits.get(imgFruits.width/numFruit*i, 0, imgFruits.width/numFruit, imgFruits.height);
- }
- for (int i =0; i < CandySet.length; i++) {
- CandySet[i] = imgCandies.get(imgCandies.width/numCandy*i, 0, imgCandies.width/numCandy, imgCandies.height);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement