Example #1
0
    public void CreateNewGem(GameObject oldGem)
    {
        int whichGem = GetRandomGemType();

        CreateCubeAt(oldGem.transform.position.x, gameVars.getYSpawnPosition(oldGem.transform.position.x), whichGem);

        gameVars.AddScore();
        if (gameOver)
        {
            gameVars.UpdateGameOverText();
        }
        //Destroy(oldGem);
        oldGem.GetComponent <GemController>().Destroy();
        doUpdateStuff = MonitorGameVelocity;
    }
Example #2
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;
         }
     }
 }
Example #3
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;
    }