//Libraries import ddf.minim.*; //sound library import processing.opengl.*; //Constants //edges of the screen for the ball final int LEFT_EDGE = -11; final int TOP_EDGE = 40; final int RIGHT_EDGE = 710; final int BOTTOM_EDGE = 460; final int GRID_SPACE = 20; //direction of motion for ball final int D = 1; final int R = 2; final int U = 3; final int L = 4; final int DR = 5; final int DL = 6; final int UL = 7; final int UR = 8; //types of pipe final int PIPE_EL1 = 1; final int PIPE_EL2 = 2; final int PIPE_EL3 = 3; final int PIPE_EL4 = 4; final int PIPE_VERT = 5; final int PIPE_HORZ = 6; final int PIPE_TEE1 = 7; final int PIPE_TEE2 = 8; final int PIPE_DIAG1 = 9; final int PIPE_DIAG2 = 10; //ball type identifiers final int RED_BALL = 1; final int GREEN_BALL = 2; final int PURP_BALL = 3; final int FLASH = 70; //length of flash when the ball goes through or hits a pipe final int TTimer = 10; //timer used by tees - number of milliseconds to wait between creating new balls final int el1num = 10; //number of pipe pieces of each type to create //Objects Background bg; //background object RestartButton restartBtn; LeadButtons leadBtns; KeysButtons keysBtns; DrumsButtons drumsBtns; SpeedButtons speedBtns; AudioSample guitar1; //these are the individual audio samples AudioSample guitar2; AudioSample guitar3; AudioSample guitar4; AudioSample guitar5; AudioSample organ1; AudioSample organ2; AudioSample organ3; AudioSample organ4; AudioSample organ5; AudioSample drum1; AudioSample drum2; AudioSample drum3; AudioSample drum4; AudioSample drum5; AudioSample sax1; AudioSample sax2; AudioSample sax3; AudioSample sax4; AudioSample sax5; AudioSample bass1; AudioSample bass2; AudioSample bass3; AudioSample bass4; AudioSample bass5; AudioSample elektro1; AudioSample elektro2; AudioSample elektro3; AudioSample elektro4; AudioSample elektro5; //variables boolean mp = false; //mp stands for mouse pressed, this turns true on mouse down boolean drag = false; //variable that turns true when a mouse drag is begun boolean dragging = false; boolean stopper; boolean sax; boolean bass; boolean elektro; int num = 100; //number of balls to allocate memory for int ballIndex, ballTotal = 0; //variables used for creating balls and cycling through array if more than 1000 are created int lastSec = -1; //variable used in timer function float speed = 5; //fonts PFont OCR; //Arrays Ball[] bl = new Ball[num]; //ball array Ball[] bl2 = new Ball[num]; Ball[] bl3 = new Ball[num]; ElPipe[] el = new ElPipe[el1num]; //pipe type arrays ElPipe[] el_2 = new ElPipe[el1num]; ElPipe[] el_3 = new ElPipe[el1num]; ElPipe[] el_4 = new ElPipe[el1num]; ElPipe[] vert = new ElPipe[el1num]; ElPipe[] horz = new ElPipe[el1num]; ElPipe[] tee1 = new ElPipe[el1num]; ElPipe[] tee2 = new ElPipe[el1num]; ElPipe[] diag1 = new ElPipe[el1num]; ElPipe[] diag2 = new ElPipe[el1num];