class MainMenu { PFont visitor; Button start; Button quit; Button instructions; boolean instructing = false; String directions = "try to stay alive as long as possible\npickup blocks to keep the screen clear,\nblocks left unpicked-up will return at the top of the screen\neach block must be processed, you may process up to 3 blocks at once\ndifferent colors of blocks take different amounts of time to process\n\narrow keys to move\np to pause\nspace to pickup objects\n\nmore to follow...\n\n\n\npress mouse to continue"; MainMenu() { visitor = loadFont("VisitorTT2BRK-72.vlw"); start = new Button("begin new game", visitor, 800, 300, 300, 30); instructions = new Button("instructions", visitor, 800, 340, 300, 30); quit = new Button("quit", visitor, 800, 380, 300, 30); start.align = RIGHT; instructions.align = RIGHT; quit.align = RIGHT; } void display() { background(0); if(instructing) { textAlign(LEFT); textFont(visitor, 24); fill(255); text(directions, 100, 325); }else{ start.display(); instructions.display(); quit.display(); } } boolean mousePressedRec() { if(instructing) { instructing = false; }else if(start.hit()) { println("starting"); return true; }else if(instructions.hit()) { println("instructions"); instructing = true; }else if(quit.hit()) { println("quitting"); exit(); } println("hit nothing"); return false; } }