Create check if it end

check if the game have ended