Ejemplo n.º 1
0
        private void MouseClicked(object sender, MouseEventArgs e)
        {
            if (MouseClickEnabled)
            {
                if (e.Button == MouseButtons.Left)
                {
                    if (TicTacToe.GameOver)
                    {
                        NewGame();
                    }
                    else
                    {
                        int row = e.Y / (Height / TicTacToe.ROWS);
                        int col = e.X / (Width / TicTacToe.COLS);

                        if (TicTacToe.Play(row, col))
                        {
                            Played(row, col);
                        }
                    }
                }
                else
                {
                    if (!Animation.Paused)
                    {
                        Animation.Pause();
                    }
                    else
                    {
                        Animation.Resume();
                    }
                }
            }
        }