Exemplo n.º 1
0
 private void checkForSelected()
 {
     if (time >= timeToSync)
     {
         PE.PuzzleSolved();
         Destroy(this.gameObject);
     }
 }
Exemplo n.º 2
0
    void checkForClearedLines()
    {
        int numOfCompleteLines = 0;

        //Columns
        for (int i = 0; i < arrayOfTiles.GetLength(0); i++)
        {
            bool completeLine = true;
            for (int j = 0; j < arrayOfTiles.GetLength(1); j++)
            {
                if (arrayOfTiles[i, j].myState != Tile.States.SET)
                {
                    completeLine = false;
                }
            }
            if (completeLine)
            {
                StartCoroutine(deleteColumn(i));
                numOfCompleteLines++;
                //  TE.startExplode(frontSpawn, 2f);
                //  TE.startExplode(leftSpawn, 2f);
                // TE.startExplode(rightSpawn, 2f);
            }
        }


        //Rows
        for (int i = 0; i < arrayOfTiles.GetLength(1); i++)
        {
            bool completeLine = true;
            for (int j = 0; j < arrayOfTiles.GetLength(0); j++)
            {
                if (arrayOfTiles[j, i].myState != Tile.States.SET)
                {
                    completeLine = false;
                }
            }
            if (completeLine)
            {
                StartCoroutine(deleteRow(i));
                numOfCompleteLines++;
                //TE.startExplode(frontSpawn, 2f);
                //    TE.startExplode(leftSpawn, 2f);
                //   TE.startExplode(rightSpawn, 2f);
            }
        }

        if (numOfCompleteLines > 0)
        {
            ScoreController.AddScore(numOfCompleteLines * numOfCompleteLines * 5000);
            pE.PuzzleSolved();
            Destroy(this.gameObject, 5f);
        }
    }
    IEnumerator spawnMoles()
    {
        for (int i = 0; i < 3; i++)
        {
            yield return(new WaitForSeconds(4f));

            spawnRandomMoles(2);
        }


        for (int i = 0; i < 3; i++)
        {
            yield return(new WaitForSeconds(4f));

            spawnRandomMoles(3);
        }
        yield return(new WaitForSeconds(20f));

        pE.PuzzleSolved();

        yield return(null);
    }
 private void OnDestroy()
 {
     floor.clearAllTiles();
     PE.PuzzleSolved();
 }