Ejemplo n.º 1
0
 private static void GeneralDestroy(GameCell[,] gameField, PictureBox[,] pictureField, int i, int j, int deltay, int deltax, Panel MainPanel)
 {
     gameField[i + deltay, j + deltax] = new Destructed();
     DestrCoords.Add(i + deltay);
     DestrCoords.Add(j + deltax);
     _click++;
     Update(i, j, deltax, deltay, gameField, pictureField, new Destructed(), new Player(), MainPanel);
 }
Ejemplo n.º 2
0
 public static void FallDown(int i, int j, GameCell[,] gameField, GameCell p)
 {
     gameField[i + 1, j] = p;
     if (gameField[i + 1, j].Type == "Destructed")
     {
         gameField[i, j] = new Destructed();
     }
     else
     {
         gameField[i, j] = new FreeArea();
     }
 }
Ejemplo n.º 3
0
 public static void Update(int i, int j, int x, int y, GameCell[,] gameField, PictureBox[,] pictureField, GameCell p1, GameCell p2, Panel MainPanel)
 {
     pictureField[i, j].Image         = new Bitmap(gameField[i, j].Image);
     pictureField[i + y, j + x].Image = new Bitmap(gameField[i + y, j + x].Image);
     if (GetClick() != 0 && p1.Type == "Player" || GetClick() != 0 && p2.Type == "Player")
     {
         GameField.IncreaseRecover();
     }
     if (GameField.GetRecover() == 7)
     {
         Destructed.ReviveCell(gameField);
         List <int> coords = GetCoords();
         for (int k = 0; k < coords.Count; k += 2)
         {
             gameField[coords[k], coords[k + 1]] = new Ground();
             Update(coords[k], coords[k + 1], 0, 0, gameField, pictureField, new FreeArea(), new Ground(), MainPanel);
         }
     }
 }