Here is a state machine which has a variable named STATE$ which holds a word for which state it is in, you can have as many states as you want, but most games just have a title screen, normal game state, and paused game state Study this code and learn how it works, because its really well known approach to making an awesome game