Exemple #1
0
        public static void OnDraw(Canvas canvas)
        {
            canvas.DrawColor(Paints.background.Color);
            Circle _circle = new Circle();

            _circle.Draw(canvas);
            Methods.DrawPoints(_points, canvas, _circle);
            if (_firstArr != null)
            {
                for (int i = 0; i < _firstArr.Length; i++)
                {
                    canvas.DrawLine(_firstArr[i].p1.X * GameView.Factor,
                                    _firstArr[i].p1.Y * GameView.Factor,
                                    _firstArr[i].p2.X * GameView.Factor,
                                    GameView.Factor * _firstArr[i].p2.Y, Paints.plSoloLine);
                }
            }
            if (_secondArr != null)
            {
                for (int j = 0; j < _secondArr.Length; j++)
                {
                    canvas.DrawLine(_secondArr[j].p1.X * GameView.Factor,
                                    _secondArr[j].p1.Y * GameView.Factor,
                                    _secondArr[j].p2.X * GameView.Factor,
                                    GameView.Factor * _secondArr[j].p2.Y, Paints.botSoloLine);
                }
            }


            if (_endGameFlag)
            {
                Paints.DrawButtonM(canvas, 100, 40, 620, 200);
                if (_blueWinner && _firstArr != null)
                {
                    for (int i = 0; i < _firstArr.Length; i++)
                    {
                        if (i == _ind1 || i == _ind2 || i == _ind3)
                        {
                            canvas.DrawLine(_firstArr[i].p1.X * GameView.Factor,
                                            _firstArr[i].p1.Y * GameView.Factor,
                                            _firstArr[i].p2.X * GameView.Factor,
                                            GameView.Factor * _firstArr[i].p2.Y, Paints.triangle);
                        }
                    }
                    Paints.DrawTextM(canvas, 180, 150, "Red win", 90, 70);
                }
                if (_redWinner && _secondArr != null)
                {
                    for (int j = 0; j < _secondArr.Length; j++)
                    {
                        if (j == _ind1 || j == _ind2 || j == _ind3)
                        {
                            canvas.DrawLine(_secondArr[j].p1.X * GameView.Factor,
                                            _secondArr[j].p1.Y * GameView.Factor,
                                            _secondArr[j].p2.X * GameView.Factor,
                                            GameView.Factor * _secondArr[j].p2.Y, Paints.triangle);
                        }
                    }
                    Paints.DrawTextM(canvas, 180, 150, "Blue win", 90, 70);
                }
            }
        }
Exemple #2
0
        public static void OnDraw(Canvas canvas)
        {
            canvas.DrawColor(Paints.background.Color);
            Circle _circle = new Circle();

            _circle.Draw(canvas);
            Methods.DrawPoints(_points, canvas, _circle);
            Paints.DrawButton(canvas, 375, 1050, 690, 1150);
            Paints.DrawText(canvas, 385, 1120, "Concede", 75, 50);
            if (_plArr != null)
            {
                for (int i = 0; i < _plArr.Length; i++)
                {
                    canvas.DrawLine(_plArr[i].p1.X * GameView.Factor,
                                    _plArr[i].p1.Y * GameView.Factor,
                                    _plArr[i].p2.X * GameView.Factor,
                                    GameView.Factor * _plArr[i].p2.Y, Paints.plSoloLine);
                }
            }
            if (_botArr != null)
            {
                for (int j = 0; j < _botArr.Length; j++)
                {
                    canvas.DrawLine(_botArr[j].p1.X * GameView.Factor,
                                    _botArr[j].p1.Y * GameView.Factor,
                                    _botArr[j].p2.X * GameView.Factor,
                                    GameView.Factor * _botArr[j].p2.Y, Paints.botSoloLine);
                }
            }
            if (_endGameFlag)
            {
                Paints.DrawButtonM(canvas, 100, 40, 620, 200);
                Paints.DrawTextM(canvas, 140, 150, "Game over", 90, 70);
                if (_winner == "bot" && _plArr != null)
                {
                    for (int i = 0; i < _plArr.Length; i++)
                    {
                        if ((i == _ind1 || i == _ind2 || i == _ind3) && _plArr != null)
                        {
                            canvas.DrawLine(_plArr[i].p1.X * GameView.Factor,
                                            _plArr[i].p1.Y * GameView.Factor,
                                            _plArr[i].p2.X * GameView.Factor,
                                            GameView.Factor * _plArr[i].p2.Y, Paints.triangle);
                        }
                    }
                }
                if (_winner == "player" && _botArr != null)
                {
                    for (int j = 0; j < _botArr.Length; j++)
                    {
                        if ((j == _ind1 || j == _ind2 || j == _ind3) && _botArr != null)
                        {
                            canvas.DrawLine(_botArr[j].p1.X * GameView.Factor,
                                            _botArr[j].p1.Y * GameView.Factor,
                                            _botArr[j].p2.X * GameView.Factor,
                                            GameView.Factor * _botArr[j].p2.Y, Paints.triangle);
                        }
                    }
                }
            }
        }