Пример #1
0
    void MonitorLevelsVelocity()
    //Monitor gems velocity - allow clicking again when landed
    //Designed For the levels game
    {
        if (gemList.Count > 0)
        {
            if (gemList[gemList.Count - 1].gameObject.GetComponent <Rigidbody>().velocity.y == 0.0f)
            {
                gemClick       = GemClicked;
                doUpdateStuff -= MonitorLevelsVelocity;
                ResetLastCombo();
            }
        }
        else
        {
            UpdateLevelText("\r\n Level done ");

            if (Stars > objectiveStars)
            {
                myBlock.LevelUpdateStars(myRank, Stars);
            }
            doUpdateStuff  = null;
            doUpdateStuff += CenterStars;
            ResetLastCombo();
            myBlock.ShowNextLevelBtn();
        }
    }
Пример #2
0
 public void WaitForStart()
 {
     if (gemList.Count > 1)
     {
         doUpdateStuff += MonitorLevelsVelocity;
         doUpdateStuff -= WaitForStart;
         Debug.Log("rank : " + myRank);
     }
 }
Пример #3
0
    public void GemClicked(GemController oldGem)
    {
        //Debug.Log("Clicked : " + oldGem.name);
        //Debug.Log("last combo : " + lastCombo);

        oldGem.raycasted = true;      //mark as part of the gems to destroy
        gemClick         = WaitClick; //send clicks to waiting function while monitoring velocity
        //lastCombo = 1;
        comboStart = true;
        oldGem.GetMeAndMySisters();//destroy gems of the same color
        doUpdateStuff += MonitorLevelsVelocity;

        Moves++;
    }
Пример #4
0
    void CenterStars()
    {
        Vector3 targetScale = starsHolder.transform.localScale * 1.3f;

        starsHolder.transform.position = Vector3.Lerp(
            starsHolder.transform.position,
            starsFinalPosition,
            Time.deltaTime);
        starsHolder.transform.localScale = Vector3.Lerp(
            starsHolder.transform.localScale,
            targetScale,
            Time.deltaTime);

        if (Vector3.Distance(starsHolder.transform.position, starsFinalPosition) < 0.1f)
        {
            doUpdateStuff -= CenterStars;
        }
    }
Пример #5
0
    void Start()
    {
        gemClick       = WaitClick;
        gemDeath       = GemDied;
        doUpdateStuff += WaitForStart;

        levelText = levelTextContainer.GetComponent <TextMesh>();
        goalsText = goalsTextContainer.GetComponent <TextMesh>();
        scoreText = movesTextContainer.GetComponent <TextMesh>();
        InitStars();
        InitMoves();
        Stars = startingStars;
        Moves = 0;
        UpdateLevelText("");

        StartCoroutine("CheckHighestCube");
        PauseGame();
        //ShowLevelGoal();
    }