Beispiel #1
0
    void Start()
    {
        scoreDisplay                = FindObjectOfType <ScoreDisplay>();
        multiplierDisplay           = FindObjectOfType <MultiplierDisplay>();
        background                  = GameObject.FindObjectOfType <Background>();
        playerAnim                  = GameObject.FindGameObjectWithTag("Player").GetComponent <Animator>();
        divisionStepChangeCountdown = divisionStepInterval;
        gameSpeed                = initialGameSpeed;
        spawnRate                = initialSpawnRate;
        rotationSpeed            = initialRotationSpeed;
        levelDesigner            = GetComponent <LevelDesigner>();
        gameManager              = FindObjectOfType <GameManager>();
        audioManager             = FindObjectOfType <AudioManager>();
        currentSelectables       = new GameObject[numberOfSelectableMods];
        currentSelectablesScript = new Module[numberOfSelectableMods];
        spawnedMods              = new GameObject[maxNumOfModsInGame]; // these does not include spawned modules that have reached the player
        spawnedModsIndex         = -1;
        selectedModIndex         = 0;
        queueLength              = levelDesigner.queueLength;
        spawnQueue               = new Vector2[queueLength];
        for (int i = 0; i < spawnQueue.Length; i++)
        {
            spawnQueue[i] = new Vector2(-1, -1);
        }
        SetProbabilities();

        //initial boost
        SetSpeed(initialGameSpeed * 10, 400, initialSpawnRate * 10, initialRotationSpeed);

        setMultiplier();
        //for at forhindre at man får en konflikt med flere setspeed kald hvis man får starpower imens spillet er ved at starte
        StartCoroutine(DisableControls());
    }
Beispiel #2
0
 void Start()
 {
     player = FindObjectOfType <Player>();
     scoreAdditionSpawnPosition = scoreAddition;
     multiplierDisplay          = FindObjectOfType <MultiplierDisplay>();
     scoreDisplay = FindObjectOfType <ScoreDisplay>();
     dead         = false;
     audioManager = FindObjectOfType <AudioManager>();
     deathScreen  = FindObjectOfType <DeathScreen>();
     deathScreen.ShowDeathScreen(false);
     pauseMenu = FindObjectOfType <PauseMenu>();
 }