Moved all gameplay code to a separate GameState class