The states

The States
The states determine the behaviour of a program. With a state I exactly know in a game e.g. where I am: Do I show the start screen, do I play, do I show the high score?
 * You have now a help screen on start-up and then the main program. This is done by states of the program. The states determine whether we see an initial help screen or the main program screen.

So in draw use a switch(state) and then handle the states.

The same goes for keyPressed and mousePressed.

before setup in draw after draw