Esempio n. 1
0
        private void FirstLevel()
        {
            button1.Visible = false;
            button5.Visible = true;

            bmp = new Bitmap(pictureBox1.Width, pictureBox1.Height);
            g   = Graphics.FromImage(bmp);

            levelFirst = new CirclesListCreator();
            FirstLevel firstLevel = new FirstLevel(i, delta_i, j, delta_j);

            arrayCircles = levelFirst.GetList();

            firstLevel.DrawBackground(g);
            firstLevel.Draw(g, arrayCircles);

            Refresh();

            mainManu = false;

            pictureBox1.Image = bmp;
        }
Esempio n. 2
0
        private void PictureBox1_MouseClick(object sender, MouseEventArgs e)
        {
            if (canDoSecondStep == false && !mainManu)
            {
                FullArrayCircles firstLevelEnd = new FullArrayCircles();
                helpForFirstM = firstLevelEnd.IsEnd(49, arrayCircles);
                if (helpForFirstM && helpForSecondM)
                {
                    MessageBox.Show("Congratulations!!!!");
                    SecondLevel();
                    helpForSecondM = false;
                    helpForFirstM  = false;
                }
                if (helpForFirstM == false && helpForSecondM)
                {
                    if (usersStep % 2 == 1 && pig % 2 == 1)
                    {
                        Refresh();

                        mouseClick_X = e.X;
                        mouseClick_Y = e.Y;

                        chosenCircle_i = (mouseClick_X - 85) / 90;
                        chosenCircle_j = (mouseClick_Y - 185) / 100;

                        FLmodification = new CirclesArrayModification(arrayCircles, 49, chosenCircle_i, chosenCircle_j, 1, 1);

                        FirstLevel FL = new FirstLevel(i, delta_i, j, delta_j);
                        FL.Draw(g, FLmodification.GetList());

                        pig++;

                        Refresh();
                    }
                    if (usersStep % 2 == 0 && pig % 2 == 0)
                    {
                        Refresh();

                        mouseClick_X = e.X;
                        mouseClick_Y = e.Y;

                        chosenCircle_i = (mouseClick_X - 85) / 90;
                        chosenCircle_j = (mouseClick_Y - 185) / 100;

                        FLmodification = new CirclesArrayModification(arrayCircles, 49, chosenCircle_i, chosenCircle_j, 2, 2);

                        FirstLevel FL = new FirstLevel(i, delta_i, j, delta_j);
                        FL.Draw(g, FLmodification.GetList());

                        pig++;

                        Refresh();
                    }
                }
            }

            else if (!mainManu)
            {
                FullArrayCircles secondLevelEnd = new FullArrayCircles();
                b_ = secondLevelEnd.IsEnd(81, arrayCircles2);
                if (b_)
                {
                    MessageBox.Show("Congratulations!!!!");
                    Close();
                }
                if (b_ == false)
                {
                    if (usersStep % 2 == 1 && pig % 2 == 1)
                    {
                        Refresh();

                        mouseClick_X = e.X;
                        mouseClick_Y = e.Y;

                        chosenCircle_i = (mouseClick_X - 12) / 85;
                        chosenCircle_j = (mouseClick_Y - 90) / 84;

                        SLmodification = new CirclesArrayModification(arrayCircles2, 81, chosenCircle_i, chosenCircle_j, 1, 1);

                        SecondLevel SL = new SecondLevel(i2, delta_i2, j2, delta_j2);
                        SL.Draw(g, SLmodification.GetList());

                        pig++;

                        Refresh();
                    }
                    if (usersStep % 2 == 0 && pig % 2 == 0)
                    {
                        Refresh();

                        mouseClick_X = e.X;
                        mouseClick_Y = e.Y;

                        chosenCircle_i = (mouseClick_X - 12) / 85;
                        chosenCircle_j = (mouseClick_Y - 90) / 84;

                        SLmodification = new CirclesArrayModification(arrayCircles2, 81, chosenCircle_i, chosenCircle_j, 2, 2);

                        SecondLevel SL = new SecondLevel(i2, delta_i2, j2, delta_j2);
                        SL.Draw(g, SLmodification.GetList());

                        pig++;

                        Refresh();
                    }
                }
            }
        }