final int BOXCOUNT = 19; final int HEARTLOC = 9; //right in the middle, matey final int BOXSIZE = 25; //in pixels final int SCREENSIZE = 600; final int WORLDCENTERX = SCREENSIZE / 2 ; final int WORLDCENTERY = SCREENSIZE / 2; final int FPS = 30; final int FRAMESPERROUND = 30; //how many frames between times we can turn final int WALL = 1; final int HEART = 2; final int EMPTY = 0; final int TURNSTEP = 10; // needs to be less than FRAMESPERROUND, how many frames we're taking up to turn things final float STEPAMOUNT = (PI / 2)/TURNSTEP; //quarter turn , 90 degrees divided by how many steps we're taking float GAMELASTS = 120;//time the game lasts in seconds final int NOTURN = 0; //isn't that clever, our constants for activeTurn are +- 1... //we can use that for our visual rotation //(and my clever I mean kind of obvious) final int TURNCW = 1; final int TURNCCW = -1; final float LEFTOFWORLD = (BOXSIZE * BOXCOUNT)*-.5; final float TOPOFWORLD = (BOXSIZE * BOXCOUNT)*-.5; final int START = 1; final int RUNNING = 2; final int ENDING = 3; //actually global, not constant: int world[][] = new int[BOXCOUNT][BOXCOUNT]; int framecount = 0; float rot = 0.0; //guy g; int nextTurn = NOTURN; int activeTurn = NOTURN; PImage imgArrowCW; PImage imgArrowCCW; HashSet guys = new HashSet(); HashSet eggs = new HashSet(); PImage imgBg; //int score; int gameState = START; PImage imgTitle; PImage imgEnding; int numberBorn;// = 2; int numberKilled;// = 0; float additionalRotateBackground; float upcomingRotateBackgroundOffset; int finalanimation; float chance = 7; int lifepoints = 0;