示例#1
0
    // Use this for initialization
    void Start()
    {
        Random    = new System.Random();
        GameLogic = GameObject.Find("Gameplay Logics").GetComponent <GHGameLogic>();


        f_Timer           = 0;
        f_SpawnDelayTimer = 0;
        i_randValue       = 0;
        i_spawnCount      = 0;
        b_Spawning        = false;
        //Set Default Combo State
        combo_state = COMBO_TYPE.COMBO_DOUBLE;

        //Set number of beats left for each player
        if (f_SpawnTime == 0)
        {
            f_SpawnTime = 0.6f;
        }

        // It needs to know how many notes it needs to spawn
        i_numBeatsLeft = (int)(GameLogic.GetGameTime() / f_SpawnTime);

        // Tells the Gameplay how much score a player can get in a game
        GameLogic.SetMaxScore(i_numBeatsLeft * MusicBar.GetMaxScore());
    }
示例#2
0
    /*
     * Function Name : Ser Combo
     * Author : Wayne
     * params : null
     * Return : void
     *
     * Description : Uses RNG to get a combo for SpawnNote(int combo) to use
     */
    void SetCombo()
    {
        i_randValue = Random.Next(1, 37);

        if (!b_Spawning)
        {
            if (i_randValue < 2)
            {
                combo_state = COMBO_TYPE.COMBO_PENTA;
            }
            else if (i_randValue > 2 && i_randValue <= 7)
            {
                combo_state = COMBO_TYPE.COMBO_QUAD;
            }
            else if (i_randValue > 7 && i_randValue <= 17)
            {
                combo_state = COMBO_TYPE.COMBO_TRIPLE;
            }
            else if (i_randValue > 17 && i_randValue <= 37)
            {
                combo_state = COMBO_TYPE.COMBO_DOUBLE;
            }
        }
        SpawnNote((int)combo_state);
    }