示例#1
0
文件: ModeSelect.cs 项目: Vadya44/Sim
 public static void OnDraw(Canvas canvas)
 {
     canvas.DrawColor(Paints.background.Color);
     Paints.DrawCircle(canvas, 360, 300, 200); // Easy
     Paints.DrawCircle(canvas, 360, 900, 200); // Hard
     canvas.DrawBitmap(_silver, 166 * GameView.Factor,
                       38 * GameView.Factor, null);
     canvas.DrawBitmap(_golden, 166 * GameView.Factor,
                       638 * GameView.Factor, null);
     Paints.DrawTextMode(canvas, 215, 340, "Easy", 130, 100);
     Paints.DrawTextMode(canvas, 215, 940, "Hard", 130, 100);
 }
示例#2
0
文件: About.cs 项目: Vadya44/Sim
 public static void OnDraw(Canvas canvas)
 {
     canvas.DrawColor(Paints.resultLose.Color);
     Paints.DrawButton(canvas, 30, 50, 690, 900);
     Paints.DrawText(canvas, 40, 180, "Application's history:", 70, 50);
     Paints.DrawText(canvas, 37, 370, "Application is created as part", 50, 30);
     Paints.DrawText(canvas, 110, 520, "of 1st year project by", 50, 30);
     Paints.DrawText(canvas, 50, 670, "Gataullin Vadim, student of", 50, 30);
     Paints.DrawText(canvas, 110, 820, " SE CS HSE. May 2k17", 50, 30);
     Paints.DrawButton(canvas, 100, 1000, 620, 1150);
     Paints.DrawText(canvas, 112, 1100, "Main menu", 100, 75);
 }
示例#3
0
 // With clicks
 public static void OnDraw(Canvas canvas)
 {
     if (_isPlWin)
     {
         Paints.DrawRes(canvas, true);
     }
     else
     {
         Paints.DrawRes(canvas, false);
     }
     Paints.DrawButton(canvas, 135, 1000, 585, 1150);
     Paints.DrawText(canvas, 138, 1100, "Main menu", 90, 60);
     Paints.DrawButton(canvas, 135, 800, 585, 950);
     Paints.DrawText(canvas, 148, 900, "New game", 90, 60);
 }
示例#4
0
 // With clicks
 public static void OnDraw(Canvas canvas)
 {
     canvas.DrawColor(Paints.background.Color);
     GameView.Instance.Invalidate();
     Paints.DrawButton(canvas, 420, 60, 700, 200);    // Solo
     Paints.DrawText(canvas, 490, 155, "Solo", 70, 40);
     Paints.DrawButton(canvas, 20, 60, 300, 200);     // PvP
     Paints.DrawText(canvas, 105, 155, "PvP", 70, 40);
     Paints.DrawButton(canvas, 20, 1050, 275, 1150);  // About
     Paints.DrawText(canvas, 50, 1120, "About", 70, 40);
     Paints.DrawButton(canvas, 445, 1050, 700, 1150); // Rules
     Paints.DrawText(canvas, 490, 1120, "Rules", 70, 40);
     ring1.Draw(canvas, animTime, 300);
     ring2.Draw(canvas, animTime, 210);
     GameView.Instance.Invalidate();
 }
示例#5
0
文件: Rules.cs 项目: Vadya44/Sim
 public static void OnDraw(Canvas canvas)
 {
     canvas.DrawColor(Paints.resultLose.Color);
     Paints.DrawButton(canvas, 30, 50, 690, 900);
     Paints.DrawText(canvas, 50, 100, "Two players take turns coloring any", 40, 20);
     Paints.DrawText(canvas, 105, 170, "uncolored lines. One player", 40, 20);
     Paints.DrawText(canvas, 110, 240, "colors in one color, and the", 40, 20);
     Paints.DrawText(canvas, 100, 310, "other colors in another color,", 40, 20);
     Paints.DrawText(canvas, 140, 380, "with each player trying to", 40, 20);
     Paints.DrawText(canvas, 33, 450, "avoid the creation of a triangle made", 40, 20);
     Paints.DrawText(canvas, 50, 530, "solely of their color (only triangles", 40, 20);
     Paints.DrawText(canvas, 95, 600, "with the dots as corners count;", 40, 20);
     Paints.DrawText(canvas, 112, 670, "intersections of lines are not", 40, 20);
     Paints.DrawText(canvas, 140, 740, "relevant); the player who", 40, 20);
     Paints.DrawText(canvas, 140, 810, "completes such a triangle", 40, 20);
     Paints.DrawText(canvas, 190, 880, "loses immediately.", 40, 20);
     Paints.DrawButton(canvas, 100, 1000, 620, 1150);
     Paints.DrawText(canvas, 112, 1100, "Main menu", 100, 75);
 }
示例#6
0
        public static void OnDraw(Canvas canvas)
        {
            canvas.DrawColor(Paints.background.Color);
            Paint ccir = new Paint();

            ccir.SetStyle(Paint.Style.Stroke);
            ccir.AntiAlias   = true;
            ccir.Color       = new Color(71, 106, 111);
            ccir.StrokeWidth = 30 * GameView.Factor;
            canvas.DrawCircle(360 * GameView.Factor, 640 * GameView.Factor,
                              300 * GameView.Factor, ccir);
            Paints.DrawCircle(canvas, 180, 400, 120); //5
            Paints.DrawCircle(canvas, 180, 850, 120); //9
            Paints.DrawCircle(canvas, 540, 400, 120); //7
            Paints.DrawCircle(canvas, 540, 850, 120); //11
            Paints.DrawTextMode(canvas, 135, 440, "6", 130, 100);
            Paints.DrawTextMode(canvas, 110, 893, "10", 130, 100);
            Paints.DrawTextMode(canvas, 505, 440, "8", 130, 100);
            Paints.DrawTextMode(canvas, 470, 893, "12", 130, 100);
            Paints.DrawTextM(canvas, 80, 100, "Choose number", 80, 50);
            Paints.DrawTextM(canvas, 210, 200, "of points", 80, 50);
        }
示例#7
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);
                }
            }
        }
示例#8
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);
                        }
                    }
                }
            }
        }