Exemple #1
0
    // Start Game - setting the level
    void Start()
    {
        //Initialize values for player to start
        isDoing         = false;
        canDoInput      = true;
        playerHumanTurn = true;
        pcControl.EnableActiveBackground(true);
        currentComboNum = 0;

        //Play audio for current level
        PlayCurrentLevelClip();

        //Set the elements for the player and the enemy
        int pcControlElement = GameState.control.baseElementIndex;

        pcControl.elementSprite.sprite = baseElementSprites[pcControlElement];
        pcControl.SetElement(pcControlElement + 2);
        int npcControlElement = Random.Range(2, 6);

        npcControl.elementSprite.sprite = baseElementSprites[npcControlElement - 2];
        npcControl.SetElement(npcControlElement);

        npcControl.RandomizeEnemyParts();
        pcControl.SetPlayerRobotPartsFromAvatar();

        SetupAudioSource();
        choice.enabled = false;
        CreateTileGrid();
        while (true)
        {
            InitTileGrid();
            Dictionary <TilePoint, Data.TileTypes> stack = FindMatch(cells);
            if (stack.Count < 1)
            {
                break;
            }
        }
        DisplayTileGrid();
        //StartCoroutine(RandomMonsterAttack(Random.Range(3f, 6f))); -------------------------------------------------------------------------------------------------- not sure why?
    }