private void SecondLevel() { restartLevel = 2; pig = 1; usersStep = 1; Refresh(); button4.Left = 11; button4.Top = 11; button5.Top = 11; button2.Visible = false; button3.Visible = true; levelSecond = new CirclesListCreator(81); SecondLevel secondLevel = new SecondLevel(i2, delta_i2, j2, delta_j2); arrayCircles2 = levelSecond.GetList(); secondLevel.DrawBackground(g); Refresh(); secondLevel.Draw(g, arrayCircles2); Refresh(); canDoSecondStep = true; }
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(); } } } }