Exemple #1
0
 void AddGemRandomlyInCells()
 {
     Gems = new Gem[Def.Width, Def.Depth + 2];
     Gems.Fill(CreateGem);
     Gems.ForEach(item => {
         if (!item)
         {
             return;
         }
         DestroyBlock(item.Cell, false);
     });
 }
Exemple #2
0
    void AddGemRandomlyInRows()
    {
        Gems = new Gem[Def.Width, Def.Depth + 2];

        int spacing = Def.Index * 2;

        for (int y = 0; y <= Gems.GetLength(1); y += spacing)
        {
            spacing++;
            var x = PRNG.Int(Def.Width);
            Gems[x, y] = CreateGem(x, y);
        }

        Gems.ForEach(item => {
            if (!item)
            {
                return;
            }
            DestroyBlock(item.Cell, false);
        });
    }