void Start()
 {
     gamePlayReadyStartAnimator = GameObject.FindWithTag("GamePlayController").GetComponent <GamePlayReadyStartAnimator>();
     gameController             = GameObject.FindWithTag("GamePlayController").GetComponent <GamePlayController>();
     modifier          = 1f - (float)PlayerPrefs.GetInt("coatLevel") / maxCoatModifierLevel;
     modifier         *= 1f + (((float)PlayerPrefs.GetInt("neighborhoodChosenFromMap") * 1.1f) / maxCoatModifierLevel);
     modifier         *= 0.5f;
     freezeTimer.value = 0;
 }
Example #2
0
    void Start()
    {
        Player.SetActive(true);
        gameplayMenus = gameObject.GetComponent <GameplayMenus>();
        gameplayMenus.hideMenusForGameStart();
        // when restarting the level we need to make sure the game is not paused
        gamePaused = false;

        // get information from PlayerPrefs
        levelChosenFromMap        = PlayerPrefs.GetInt("levelChosenFromMap");
        neighborhoodChosenFromMap = PlayerPrefs.GetInt("neighborhoodChosenFromMap");
        shovelLevel = PlayerPrefs.GetInt("shovelLevel");
        money       = PlayerPrefs.GetInt("money");

        // calculate how the level should act
        difficultyLevel         = levelChosenFromMap * neighborhoodChosenFromMap;
        numberOfRowsOnThisLevel = baseNumberOfRows + neighborhoodChosenFromMap;
        tileOriginalScale       = SnowMove.transform.localScale;

        freezeTimerController = GameObject.FindWithTag("GamePlayController").GetComponent <FreezeTimerController>();
        freezeTimerController.ResetTimer();

        gamePlayReadyStartAnimator = GameObject.FindWithTag("GamePlayController").GetComponent <GamePlayReadyStartAnimator>();

        musicManager = GameObject.FindWithTag("GamePlayController").GetComponent <MusicManager>();

        // display the Ready/Start at the beginning of the level
        gamePlayReadyStartAnimator.StartAnimation();

        Vector3 arrowsStartingPoint   = new Vector3(-2.5f, 0.5f, 2.5f);
        float   spaceBetweenEachArrow = 1.9f;
        int     arrowsPerRow          = 6;
        int     numberOfRows          = 3;

        for (int i = 0; i < numberOfRows; i++)
        {
            for (int j = 0; j < arrowsPerRow; j++)
            {
                swipesToClearThisTileArrows.Add(
                    Instantiate(
                        arrowPrefab,
                        new Vector3(
                            arrowsStartingPoint.x + spaceBetweenEachArrow * (float)j,
                            arrowsStartingPoint.y,
                            arrowsStartingPoint.z - spaceBetweenEachArrow * (float)i
                            ),
                        Quaternion.Euler(new Vector3(90f, 0f, 0f))

                        )
                    );
            }
        }

        buildSwipes();
        freezeTimerController.UnPauseTimer();
    }