Update method to decide if the game was ended