Esempio n. 1
0
    private void Start()
    {
        float difficulty = MinigameManager.GetDifficulty();


        gameStart = false;
        StartCoroutine(roundCounter());

        AudioManager.instance.SetSFXPitch(0.8f, 1.0f);

        playerHealth = 100;

        enemyStartHealth = Mathf.LerpUnclamped(60, 200, MinigameManager.GetDifficulty());
        enemyHealth      = enemyStartHealth;

        for (int t = 0; t < buttonOptions.Length; t++)
        {
            string tmp = buttonOptions[t];
            int    r   = Random.Range(t, buttonOptions.Length);
            buttonOptions[t] = buttonOptions[r];
            buttonOptions[r] = tmp;
        }

        for (int i = 0; i < buttonOptions.Length; i++)
        {
            displayBox.GetComponent <Text>().text += buttonOptions[i] + " ";
        }
        winState = 0;

        InvokeRepeating("enemyAttackFunction", 3, 3f);
    }
 void Start()
 {
     food.SetActive(false);
     initialBGPosition  = bgTransform.position;
     initialPanPosition = panTransform.position;
     maxTime            = Mathf.Lerp(5f, 1f, MinigameManager.GetDifficulty());
     StartCoroutine(GameLoop(3));
 }
Esempio n. 3
0
        #pragma warning restore 0649

        void Start()
        {
            Canvas.SetActive(false);
            Panel_Lose.SetActive(false);
            Panel_Win.SetActive(false);
            playerCollider     = player.GetComponent <Collider2D>();
            enemyCollider      = enemy.GetComponent <Collider2D>();
            groundCollider     = ground.GetComponent <Collider2D>();
            difficultyModifier = MinigameManager.GetDifficulty();
            changeSpeed        = 1.5f;
            enemySpeed         = Mathf.LerpUnclamped(1, 3.3f, difficultyModifier);
            player.SetMoveForward(changeSpeed);
            nextActionTime = Time.time + period;
            AudioManager.instance.PlayMusic(RunAwayThiefMusic, 0.9f, 1.0f, true);
        }
Esempio n. 4
0
        // Start is called before the first frame update
        void Start()
        {
            difficulty = MinigameManager.GetDifficulty();

            isOverflowing           = false;
            isOverflowSystemPlaying = false;

            canTakeInput = true;
            timeBuffer   = 0.5f;

            score          = 0;
            scoreText      = GameObject.Find("ScoreText").GetComponent <Text>();
            scoreText.text = score.ToString();

            //countdownTime = 20f;
            countdownTime = Mathf.LerpUnclamped(30f, 20, difficulty);
            timeText      = GameObject.Find("TimeText").GetComponent <Text>();
            timeText.text = countdownTime.ToString();

            fillRate = Mathf.LerpUnclamped(0.5f, 0.75f, difficulty);

            potionsNeeded          = Mathf.RoundToInt(Mathf.LerpUnclamped(2, 5, difficulty));
            PotionsNeededText      = GameObject.Find("PotionsNeededText").GetComponent <Text>();
            PotionsNeededText.text = "Potions needed: \n" + potionsNeeded.ToString();

            redArrow    = GameObject.Find("red key");
            yellowArrow = GameObject.Find("yellow key");
            blueArrow   = GameObject.Find("blue key");
            trashArrow  = GameObject.Find("trash key");

            filled     = 0;
            r          = 0;
            g          = 0;
            b          = 0;
            opaqueness = 1;

            //Instantiate(fillLine, bottleOrigin.transform.position + new Vector3(0, filledSize * .5f, 0), Quaternion.identity);

            instantiatedOverflowParticles = Instantiate(overflowParticles, bottleOrigin.transform.position + new Vector3(0, filledSize, 0), Quaternion.Euler(-90, 0, 0));
            overflowSystem = instantiatedOverflowParticles.GetComponent <ParticleSystem>();
            overflowSystem.Stop();
            overflowMain = instantiatedOverflowParticles.GetComponent <ParticleSystem>().main;

            NewColorTarget();
        }
Esempio n. 5
0
        // Start is called before the first frame update
        void Start()
        {
            float difficulty = MinigameManager.GetDifficulty();

            timeLimit       = Mathf.LerpUnclamped(16f, 2f, difficulty);
            liftUpSpeedMult = Mathf.LerpUnclamped(1, 5, difficulty);
            GetComponent <Rigidbody2D>().gravityScale = Mathf.LerpUnclamped(1, 5, difficulty);

            startPosition   = transform.position;
            successPosition = SuccessArea.transform.position;

            if (wire_Count == -1)
            {
                timer = timeLimit;
            }
            else
            {
                timer = newTimer;
            }
            wire_Count++;

            if (!minigameOver)
            {
                pinSpriteIndex = FindPinSpriteIndex();
            }
            if (remaining[pinSpriteIndex] == -1 && !minigameOver)
            {
                FindPinSpriteIndex();
                successPosition.y = spriteLocation[pinSpriteIndex];
                SuccessArea.transform.position = successPosition;
            }
            successPosition.y = spriteLocation[pinSpriteIndex];
            SuccessArea.transform.position = successPosition;

            secondWire.GetComponent <Wire>().SuccessArea = SuccessArea;
            secondWire.GetComponent <Wire>().uiText      = uiText;

            unlock.clip  = unlockLock;
            pushPin.clip = pinPush;
        }
Esempio n. 6
0
 // Start is called before the first frame update
 void Start()
 {
     delayMult = Mathf.Lerp(1, 0.6f, MinigameManager.GetDifficulty());
     speedMult = Mathf.Lerp(1, 1.3f, MinigameManager.GetDifficulty());
     StartCoroutine(delayedSpawn(0));
 }
        void Start()
        {
            difficulty = MinigameManager.GetDifficulty();

            gameOn        = true;
            goodiesKilled = 0;

            totalBaddies      = Mathf.RoundToInt(Mathf.LerpUnclamped(3, 5, difficulty));
            goodieBottomSpeed = 3;
            goodieTopSpeed    = 20;
            spawnRate         = Mathf.LerpUnclamped(3, 10, difficulty);
            baddie.gameObject.GetComponent <Terrorist>().speed = Mathf.LerpUnclamped(7, 10, difficulty);

            float camHeight = cam.orthographicSize * 2;
            float camWidth  = camHeight * Screen.width / Screen.height;

            diameter  = 2 * baddie.GetComponent <CircleCollider2D>().radius;
            diameter *= 1.1f;

            xLower = (cam.transform.position.x - (camWidth / 2));
            xUpper = (cam.transform.position.x + (camWidth / 2));
            yLower = (cam.transform.position.y - (camHeight / 2));
            yUpper = (cam.transform.position.y + (camHeight / 2));

            //spawns baddies
            currentBaddies = 0;
            for (int i = 0; i < totalBaddies; i++)
            {
                Instantiate(baddie, new Vector2(Random.Range(xLower + diameter, xUpper - diameter), Random.Range(yLower + diameter, yUpper - diameter)), Quaternion.identity);
                currentBaddies++;
            }

            //spawns initial goodies (# based on bottom speed)
            for (int i = 0; i < Mathf.RoundToInt(spawnRate); i++)
            {
                GameObject newGoodie = Instantiate(goodie, new Vector2(Random.Range(xLower + diameter, xUpper - diameter), Random.Range(yLower + diameter, yUpper - diameter)), Quaternion.identity);
                int        dir       = Random.Range(1, 5);
                switch (dir)
                {
                case 1:
                    newGoodie.GetComponent <Rigidbody2D>().velocity = new Vector2(0, -Random.Range(goodieBottomSpeed, goodieTopSpeed));
                    break;

                case 2:
                    newGoodie.GetComponent <Rigidbody2D>().velocity = new Vector2(Random.Range(goodieBottomSpeed, goodieTopSpeed), 0);
                    break;

                case 3:
                    newGoodie.GetComponent <Rigidbody2D>().velocity = new Vector2(0, Random.Range(goodieBottomSpeed, goodieTopSpeed));
                    break;

                case 4:
                    newGoodie.GetComponent <Rigidbody2D>().velocity = new Vector2(-Random.Range(goodieBottomSpeed, goodieTopSpeed), 0);
                    break;
                }
            }

            //spawns first goodie outside bounds
            SpawnGoodie((SpawnLocation)Random.Range(1, 5));
            timeLastSpawn = Time.time;
        }