Exemplo n.º 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();
        }
    }
Exemplo n.º 2
0
 void GemClicked(GemController oldGem)
 {
     //Debug.Log("GemClick");
     oldGem.raycasted = true;                                                       //mark as part of the gems to destroy
     gemClick         = WaitClick;                                                  //send clicks to waitin function while monitoring velocity
     gameVars.GemClicked(oldGem.dynamicGemType, gemsColors[oldGem.dynamicGemType]); //send gem type to score data
     gameVars.SetComboScore();                                                      //start comboingScore
     oldGem.GetMeAndMySisters();                                                    //destroy gems of the same color
     gameVars.Moves++;                                                              //add a move to the move counter
 }
Exemplo n.º 3
0
 public void LoadMenu()
 {
     if (!gameOver)
     {
         gemClick = WaitClick;
         confirmExitHolder.SetActive(true);
     }
     else
     {
         LoadMenuConfirmed();
     }
 }
Exemplo n.º 4
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++;
    }
Exemplo n.º 5
0
 void MonitorGameVelocity()
 //Monitor last created gem's velocity - allow clicking again when landed, reset spawn array (upwards from board), go back to no bonus scoring
 //Designed For the scoring game
 {
     if (fullList[fullList.Count - 1].gameObject.GetComponent <Rigidbody>().velocity.y > 0.0f)
     {
         gameVars.ResetSpawnArray();
         gameVars.SetRegularScore();
         if (!gameOver)
         {
             gemClick      = GemClicked;
             doUpdateStuff = null;
         }
     }
 }
Exemplo n.º 6
0
    void Awake()
    {
        if (gemsPrefabs == null || gemsPrefabs.Count < 5)
        {
            Debug.Log("Warning not enough prefabs set");
        }


        if (SceneManager.GetActiveScene().name == "FacebookGameScene" || SceneManager.GetActiveScene().name == "FreeplayGameScene")
        {
            gemClick = GemClicked;
            gemDeath = CreateNewGem;
            gameVars = gameObject.GetComponent <GameVariables>();
        }

        doUpdateStuff = null;
    }
Exemplo n.º 7
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();
    }
Exemplo n.º 8
0
 public void HideConfirmExit()
 {
     gemClick = GemClicked;
     confirmExitHolder.SetActive(false);
 }
Exemplo n.º 9
0
 void Awake()
 {
     gameVars = gameObject.GetComponent <GameVariables>();
     gemClick = CreateNewGem;
 }