implemented tracking of checkpoints reached and opening gate

 when all checkpoints are reached.
also added a gamestate class to keep track of the state of the game.