//The "intro" screen. This is the first thing the player sees. class IntroState extends GameState { void init(GameEngine game){ println("IntroState : init()"); noCursor(); } void cleanup(){ println("IntroState : cleanup()"); } void mouseReleased(GameEngine game){ //Left click -> start game if ( mouseButton == LEFT ){ game.changeState(new PlayState(game.firstMap(), 0, initialLives)); } } void draw(GameEngine game){ background(255); textAlign(LEFT, BASELINE); String message = "Another Breakout Clone"; textSize(48); fill(0); text(message, (width - textWidth(message))/2, (height - 48)/2); message = "click to start"; textSize(24); fill(100); /* //Make the text fade in and out cyclically fill( map( abs(cos( float(millis()) / 400f )), -1, 1, 0, 250 ) ); */ text(message, (width - textWidth(message))/2, (height - 48)/2 + 30); } }