updated the game loop and the Player class