Esempio n. 1
0
    //CLEARS OUT WHAT NEEDS TO BE CLEARED OUT.
    //It also handles doling out scores.
    //It also passes damage to be applied to enemies in the enemy manager.
    void clearComboed()
    {
        // Amount of tiles destroyed
        int hits = 0;

        int[] damageArray = new int[4];

        for (int x = 0; x < colorBlockArray.GetLength(0); x++)
        {
            for (int y = 0; y < colorBlockArray.GetLength(1); y++)
            {
                if (colorBlockArray[x, y] != null)
                {
                    if (colorBlockArray[x, y].isInScoreCombo)
                    {
                        hits++;                                                             //Increment number of hits.
                        TILE_SCORE += 2;                                                    //Increment our score

                        damageArray[colorBlockArray[x, y].getColor()] += hits * TILE_SCORE; //Tell how much damage we will be doing to this color

                        removeBlock(x, y);                                                  //Kill the Batman.
                    }
                }
            }
        }
        score     += hits * TILE_SCORE;
        TILE_SCORE = 0;
        eMan.applyDamage(damageArray);
    }