private void Update()
    {
        CalculateMultiplier();
        string distractionText = "";

        if (IsDistractions() > 0)
        {
            distractionText = IsDistractions() + " DISTRACTION(S) ";
        }

        if (RemainingTimeController.IsCrunchTime())
        {
            distractionText = "CRUNCH TIME!!! ";
            if (multiplier < 2)
            {
                multiplier = 2f;
            }
        }

        text.text = "SCORE: " + score + "\n" + distractionText + "MULTI: " + multiplier + "X";

        LetterController.maxSpeed = multiplier * 0.9f;
        Spawner.spawnSpeed        = (1 / multiplier) * 1.1f;

        comboBar.SetStatus(combo / 90);

        ComboDecay();
    }
Example #2
0
    private void SpawnNewLetter()
    {
        GameObject newLetter  = Instantiate(letter);
        int        spawnPoint = Random.Range(0, spawnPoints.Length);

        newLetter.transform.position = spawnPoints[spawnPoint].transform.position;
        newLetter.transform.parent   = console.transform;
        if (RemainingTimeController.IsCrunchTime())
        {
            Rigidbody2D body = newLetter.GetComponent <Rigidbody2D>();
            body.AddForce(Random.insideUnitCircle, ForceMode2D.Impulse);
            body.AddTorque(Random.Range(-1f, 1f), ForceMode2D.Impulse);
        }
        newLetter.GetComponent <LetterController>().letter = (char)Random.Range(65, 91);
    }