Exemplo n.º 1
0
        private void newGameBtn_MouseUp(object sender, MouseEventArgs e)
        {
            if ((Control)sender == GetChildAtPoint(PointToClient(Cursor.Position)))
            {
                newGameBtn.Image = Properties.Resources.button_new_game;

                game.changePlayer(new Human(this, pipeName), 1);
                game.changePlayer(new Human(this, pipeName), 2);
                game.Reset();
                Human.StopPipe(pipeName);
                if (!mainLoopThread.IsAlive)
                {
                    mainLoopThread = new Thread(mainLoop);
                    mainLoopThread.Start();
                    mainLoopThread.IsBackground = true;
                }
                ResetGame();
            }
        }