Added proper input handling to the Game class.