Esempio n. 1
0
        private void increase_button_Click(object sender, EventArgs e)
        {
            // Increment x co-ordinate of the sensors to the right
            for (int x = 0; x < sensorLst.Count; x++)
            {
                Microsoft.VisualBasic.PowerPacks.OvalShape currSensor = sensorLst[x];
                // Check if passes upper limit of x = 1130, if true break.
                if (currSensor.Left + 20 > 1130)
                {
                    break;
                }
                else
                {
                    currSensor.Left += 20;
                }
            }

            // Increment x co-ordinate of the lines to match the sensors
            for (int x = 0; x < rows; x++)
            {
                for (int y = 0; y < cols; y++)
                {
                    Microsoft.VisualBasic.PowerPacks.LineShape currLine = linesLst[x, y];
                    // Check if at upper limit of x = 1139, if true break.
                    if (currLine.X2 + 20 > 1139)
                    {
                        break;
                    }
                    else
                    {
                        currLine.X2 += 20;
                    }
                }
            }
        }
        int blue = 0, pink = 0; //position on board controller

        public snakeLadder()
        {
            InitializeComponent();
            for (int i = 0; i <= 100; i++)
            {
                player1[i] = new path();
                player2[i] = new path();
            }
            for (int i = 0; i <= 8; i++)
            {
                OS[i] = new Microsoft.VisualBasic.PowerPacks.OvalShape();
            }
        }
Esempio n. 3
0
        private void default_button_Click(object sender, EventArgs e)
        {
            // Change location of all sensors to 1130, max fit
            for (int x = 0; x < sensorLst.Count; x++)
            {
                Microsoft.VisualBasic.PowerPacks.OvalShape currLine = sensorLst[x];
                currLine.Left = 1130;
            }

            // Change x2 of all lines to 1139 to match the sensors
            for (int x = 0; x < rows; x++)
            {
                for (int y = 0; y < cols; y++)
                {
                    Microsoft.VisualBasic.PowerPacks.LineShape currLine = linesLst[x, y];
                    currLine.X2 = 1139;
                }
            }
        }
Esempio n. 4
0
        private Microsoft.VisualBasic.PowerPacks.ShapeContainer newOvalShape(int x, int y, int sh, int sw, string name, Color color)
        {
            Microsoft.VisualBasic.PowerPacks.ShapeContainer shapeContaineroval = new Microsoft.VisualBasic.PowerPacks.ShapeContainer();
            Microsoft.VisualBasic.PowerPacks.OvalShape      ovalShape1         = new Microsoft.VisualBasic.PowerPacks.OvalShape();
            ovalShape1.Location  = new System.Drawing.Point(x, y);
            ovalShape1.Name      = name;
            ovalShape1.Size      = new System.Drawing.Size(sh, sw);
            ovalShape1.BackStyle = BackStyle.Opaque;
            ovalShape1.BackColor = color;//Color.Lime;

            shapeContaineroval.Location = new System.Drawing.Point(0, 0);
            shapeContaineroval.Margin   = new System.Windows.Forms.Padding(0);
            shapeContaineroval.Name     = "shapeContainer1";
            shapeContaineroval.Shapes.AddRange(new Microsoft.VisualBasic.PowerPacks.Shape[] { ovalShape1 });
            shapeContaineroval.Size     = new System.Drawing.Size(645, 614);
            shapeContaineroval.TabIndex = 0;
            shapeContaineroval.TabStop  = false;
            return(shapeContaineroval);
        }
Esempio n. 5
0
        private void decrease_button_Click(object sender, EventArgs e)
        {
            // Decrement x co-ordinate of the sensors to the left
            for (int x = 0; x < sensorLst.Count; x++)
            {
                Microsoft.VisualBasic.PowerPacks.OvalShape currSensor = sensorLst[x];
                // Check if passes Lower limit of x = 18, if true break.
                if (currSensor.Left - 20 < 18)
                {
                    break;
                }
                else
                {
                    currSensor.Left -= 20;
                }
            }

            // Decrement x co-ordinate of the lines to match the sensors
            for (int x = 0; x < rows; x++)
            {
                for (int y = 0; y < cols; y++)
                {
                    Microsoft.VisualBasic.PowerPacks.LineShape currLine = linesLst[x, y];

                    // Check if passes lower limit of x = 18, if true break.
                    if (currLine.X2 - 20 < 27)
                    {
                        break;
                    }
                    else
                    {
                        currLine.X2 -= 20;
                    }
                }
            }
        }