Exercise E

By nsmith

int page = 0; PImage A; PImage B; PImage C; PImage D; PImage E; PImage Ball; void setup(){ smooth(); size(400, 400); background(255); //loading images A = loadImage("A.png"); B = loadImage("B.png"); C = loadImage("C.png"); D = loadImage("D.png"); E = loadImage("E.png"); Ball = loadImage ("ball.png"); if(page == 0){ PFont stencil30 = loadFont("Stencil-30.vlw"); textFont(stencil30); fill(0); text("The Hall of Ballers", 30, 40); text("...Lace up your Kicks!!", 30, 65); image(Ball, 80, 80); PFont zapfino15 = loadFont("Zapfino-15.vlw"); textFont(zapfino15); fill(0); text("Click", 20, 350); text ("a, b, c, d, e", 8, 380); } } void draw() { if ((keyPressed==true) && (key == 'a')) { page = 1; } else if((keyPressed==true) && (key == 'b')){ page = 2; } else if((keyPressed==true) && (key == 'c')){ page = 3; } else if((keyPressed==true) && (key == 'd')){ page = 4; } else if((keyPressed==true) && (key == 'e')){ page = 5; } if(page == 1){ background(255); PFont zapfino15 = loadFont("Zapfino-15.vlw"); textFont(zapfino15); fill(255); image(A, 0, 0); text("Ray ALLEN!", 50, 50); } else if(page == 2){ background(255); PFont zapfino15 = loadFont("Zapfino-15.vlw"); textFont(zapfino15); fill(255); image(B, 0, 0); text("Shane", 260, 100); text ("BATTTIER!", 255, 130); } else if(page == 3){ background(255); PFont zapfino15 = loadFont("Zapfino-15.vlw"); textFont(zapfino15); fill(255); image(C, 0, 0); text("Vince CARTER!", 230, 150); } else if(page == 4){ background(255); PFont zapfino15 = loadFont("Zapfino-15.vlw"); textFont(zapfino15); fill(255); image (D, 0, 0); text("Clyde DREXLER!", 205, 200); } else if(page == 5){ background(0); PFont zapfino15 = loadFont("Zapfino-15.vlw"); textFont(zapfino15); fill(255); image(E, 0, 0); text("Monte ELLIS!", 220, 50); } }