Пример #1
0
    public void SpawnGirls()
    {
        micrograme = GetComponent <Microgame> ();

        num = Random.Range(min, max + 1);

        for (int i = 0; i < num; i++)
        {
            float      x         = Random.Range(minX, maxX);
            float      y         = Random.Range(minY, maxY);
            Vector2    pos       = new Vector2(x, y);
            GameObject PartyGirl = Instantiate(girl, pos, Quaternion.identity);
            micrograme.OnInstantiateObject(PartyGirl);
        }

        int boyNum = Random.Range(boyMin, boyMax + 1);

        for (int i = 0; i < boyNum; i++)
        {
            float      x              = Random.Range(minX, maxX);
            float      y              = Random.Range(minY, maxY);
            Vector2    pos            = new Vector2(x, y);
            GameObject DistractingBoi = Instantiate(boy, pos, Quaternion.identity);
            micrograme.OnInstantiateObject(DistractingBoi);
        }

        gameStarted = true;
    }
Пример #2
0
 void shuffleBatches()
 {
     for (int i = 0; i < microgamePool.microgameBatches.Length; i++)
     {
         Microgame[] pool = microgamePool.microgameBatches[i].pool;
         int         choice;
         Microgame   hold;
         for (int j = 0; j < pool.Length; j++)
         {
             choice = Random.Range(j, pool.Length);
             if (choice != j)
             {
                 hold         = pool[j];
                 pool[j]      = pool[choice];
                 pool[choice] = hold;
             }
         }
     }
     if (revisiting && useAllBossesWhenRevisiting)
     {
         var bossMicrogames = MicrogameCollection.instance.BossMicrogames;
         var randomBossData = bossMicrogames[Random.Range(0, bossMicrogames.Count)];
         selectedBossMicrogame = new Microgame(randomBossData.microgameId, microgamePool.bossMicrogame.baseDifficulty);
     }
     else
     {
         selectedBossMicrogame = microgamePool.bossMicrogame;
     }
 }
Пример #3
0
    public override Microgame getMicrogame(int num)
    {
        Microgame microgame = new Microgame(microgameId);

        microgame.microgameId = microgameId;
        return(microgame);
    }
Пример #4
0
    public override Microgame getMicrogame(int num)
    {
        Microgame microgame = new Microgame(microgameId);

        microgame.microgameId = !string.IsNullOrEmpty(forceMicrogame) ? forceMicrogame : microgameId;
        return(microgame);
    }
Пример #5
0
    // Use this for initialization
    void Start()
    {
        microgame = GetComponent <Microgame>();

        // Get Main Camera height and width
        camHeight = microgame.Camera.orthographicSize * 2f;
        camWidth  = camHeight * Camera.main.aspect;
    }
Пример #6
0
    // Use this for initialization
    void Start()
    {
        _microgame = GetComponent <Microgame>();

        _Man.sprite = _UpPosition;

        randomizeRange();
        _PushupsRemaining = _PushupsRequired + Random.Range(0, _PushupVariance);
    }
Пример #7
0
    public override Interruption[] getInterruptions(int num)
    {
        Microgame microgame = getMicrogame(num);
        int       index     = getIndex(num);

        //Boss over
        if (!revisiting && bossWon)
        {
            return(new Interruption[0].add(wonStage));
        }
        else if (roundsCompleted > 0 && num == roundStartIndex)
        {
            //TODO more after-boss stuff
            if (bossWon)
            {
                if (StageController.instance.getLife() < getMaxLife())
                {
                    StageController.instance.setLife(StageController.instance.getLife() + 1);
                    return(new Interruption[0].add(oneUp));
                }
                //TODO separate next round after oneUp when we have music
            }
            return(new Interruption[0].add(nextRound));
        }

        //Boss Intro
        if (microgame.microgameId.Equals(microgamePool.bossMicrogame.microgameId))
        {
            if (getMicrogame(num - 1).microgameId.Equals(microgamePool.bossMicrogame.microgameId))  //Not first boss attempt
            {
                return(new Interruption[0]);
            }
            else
            {
                return(new Interruption[0].add(bossIntro));
            }
        }

        //Speed up check
        for (int i = 0; i < microgamePool.speedUpTimes.Length; i++)
        {
            if (microgamePool.speedUpTimes[i] == index)
            {
                return(new Interruption[0].add(speedUp));
            }
        }

        return(new Interruption[0]);
    }
Пример #8
0
    int getMicrogameDifficulty(int index)
    {
        Microgame microgame = microgamePool[index];

        if (!difficultyIncreaseOn)
        {
            return(microgame.baseDifficulty);
        }

        int difficulty = round + microgame.baseDifficulty - 1;

        if (difficulty > 3)
        {
            difficulty = 3;
        }

        return(difficulty);
    }
Пример #9
0
    public void RegisterMicrogame(Microgame game)
    {
        var name = game.gameObject.scene.name;

        for (int x = 0; x < _LoadingMicrogames.Length; x++)
        {
            if (!name.Equals(_LoadingMicrogames[x]))
            {
                continue;
            }
            Debug.Assert(_LoadedMicrogames[x] == null);

            _LoadingMicrogames[x] = null;
            _LoadedMicrogames[x]  = game;
            game.StartMicrogame(_Players[x]);
            return;
        }
    }
Пример #10
0
 public void DeregisterMicrogame(Microgame game, bool won)
 {
     for (int x = 0; x < _LoadedMicrogames.Length; x++)
     {
         if (_LoadedMicrogames[x] == game)
         {
             if (won)
             {
                 _Players[x].UIAnimator.SetTrigger("win");
             }
             else
             {
                 _Players[x].UIAnimator.SetTrigger("lose");
             }
             npcs[x] = null;
             _LoadedMicrogames[x] = null;
             return;
         }
     }
 }
Пример #11
0
    // Use this for initialization
    void Start()
    {
        _microgame        = GetComponent <Microgame>();
        _currentDirection = SpriteDirection.right;

        if (_microgame.Owner.PlayerNumber == PlayerID.One)
        {
            _YellowDancingImage.gameObject.SetActive(true);
        }
        else
        {
            _BlueDancingImage.gameObject.SetActive(true);
        }

        _HitsRemaining = _HitsRequired + Random.Range(0, _HitsVariance);

        // Get Main Camera height and width
        camHeight = _microgame.Camera.orthographicSize * 2f;
        camWidth  = camHeight * Camera.main.aspect;
    }
Пример #12
0
 /// <summary>
 /// Gets microgame difficulty for this specific instance
 /// </summary>
 /// <param name="microgame"></param>
 /// <param name="num"></param>
 /// <returns></returns>
 public abstract int getMicrogameDifficulty(Microgame microgame, int num);
Пример #13
0
 bool isSelectedBoss(Microgame microgame) => microgame.microgameId.Equals(selectedBossMicrogame.microgameId);
Пример #14
0
 // Use this for initialization
 void Start()
 {
     micrograme = GetComponent <Microgame> ();
 }
Пример #15
0
 public override int getMicrogameDifficulty(Microgame microgame, int num)
 {
     return(Mathf.Min(roundsCompleted + 1, 3));
 }
Пример #16
0
    public override Microgame getMicrogame(int num)
    {
        Microgame microgame = microgamePool[num - roundStartIndex];

        return(microgame);
    }
Пример #17
0
    void startMicrogame()
    {
        Microgame microgame = microgamePool[getMicrogameIndex()];

        microgame.asyncOperation.allowSceneActivation = true;
    }
Пример #18
0
 public override int getMicrogameDifficulty(Microgame microgame, int num)
 {
     return(forceDifficulty < 1 ? ((num % 3) + 1) : forceDifficulty);
 }
Пример #19
0
 public override int getMicrogameDifficulty(Microgame microgame, int num)
 {
     return((num % 3) + 1);
 }