Example #1
0
 public void goToMenu()
 {
     lastScreenActive(true);
     lastScreenScore.text = "" + score.GetValue();
     if (kongBuild)
     {
         kongComp.SendScore(score.GetValue());
     }
 }
Example #2
0
    void matchBlocks()
    {
        int bonusint = bonusMultiplier.GetValue();

        GameObject btextScore = Instantiate(bonusText, Input.mousePosition + new Vector3(0, 30, 0), Quaternion.identity);


        if (bonusint >= 6)
        {
            GameObject btext = Instantiate(bonusText, Input.mousePosition, Quaternion.identity);
            if (bonusint >= 4 && bonusint <= 10)
            {
                btext.GetComponent <TextPopUp>().assign("Good", Color.yellow, 20);
                updateScore(10 + bonusMultiplier.GetValue() * 2, btextScore);
            }
            else if (bonusint >= 11 && bonusint <= 18)
            {
                btext.GetComponent <TextPopUp>().assign("Great", Color.blue, 25);
                updateScore(10 + bonusMultiplier.GetValue() * 3, btextScore);
            }
            else if (bonusint >= 19 && bonusint <= 28)
            {
                btext.GetComponent <TextPopUp>().assign("Splendid", Color.green, 30);
                updateScore(10 + bonusMultiplier.GetValue() * 4, btextScore);
            }
            else if (bonusint + 1 == allPairs)
            {
                audioSource.PlayOneShot(sound[1], 1);
                Instantiate(boomEffect, block2.gameObject.transform.position, transform.rotation);

                btext.GetComponent <TextPopUp>().assign("FLAWLESS", Color.white, 50);
                updateScore(100 + bonusMultiplier.GetValue() * 6, btextScore);
            }
            else
            {
                btext.GetComponent <TextPopUp>().assign("Excellent", Color.magenta, 35);
                updateScore(10 + bonusMultiplier.GetValue() * 5, btextScore);
            }
        }
        else
        {
            updateScore(10 + bonusMultiplier.GetValue(), btextScore);
        }


        bonusTimer       = 3f;
        bonusMultiplier += new SafeInt(1);

        audioSource.PlayOneShot(sound[0], 1);

        Instantiate(effect, block1.gameObject.transform.position, transform.rotation);
        Instantiate(effect, block2.gameObject.transform.position, transform.rotation);

        blockScript.Remove(block1);
        blockScript.Remove(block2);

        /*
         * NOTE:
         *      since Destroy(gameObject) driven me crazy, I decided
         *      just to throw blocks out of screen and change their tag.
         *
         *      //Destroy(block1.gameObject)
         *      //Destroy(block2.gameObject)
         *
         *      Here lies two hours of sorrow and madness
         */

        block1.gameObject.transform.position = new Vector3(999, 999, 999);
        block2.gameObject.transform.position = new Vector3(999, 999, 999);
        block1.gameObject.tag = "defeated";
        block2.gameObject.tag = "defeated";


        UI_selected.texture = emptyTexture;
        UI_viewed.texture   = emptyTexture;

        highlightSelected.transform.position = new Vector3(0, 0, -100);
        highlightViewed.transform.position   = new Vector3(0, 0, -100);

        block1 = null;
        block2 = null;

        //any blocks left?
        if (anyBlocks())
        {
            //check possible moves
            checkMoves();
        }
    }
Example #3
0
 // Use this for initialization
 void Start()
 {
     Debug.Log("Default stars: " + stars.GetValue());
     Debug.Log("Inc stars: " + stars.GetValue());
 }