Exemplo n.º 1
0
    void OnTriggerEnter2D(Collider2D other)
    {
        var gameControl = other.gameObject.GetComponent <GameControl> ();

        if (gameControl)
        {
            gameControl.SendMessage("CharacterCollision");
        }

        if (other.tag == "Pickup" && other.gameObject.GetComponent <Renderer>().enabled)
        {
            // remove carrot
            other.gameObject.GetComponent <Renderer>().enabled = false;

            // update score
            currentScore++;

            if (this.tag == "Scene1")
            {
                UpdateScore();
                if (currentScore == MAX_SCORE)
                {
                    winPickupGame();
                }
            }
            else
            {
                King.GetComponent <KingScript>().CausePain(currentScore);
            }
        }
    }
Exemplo n.º 2
0
    void resetRevengeStage()
    {
        currentScore = 0;
        King.GetComponent <Transform> ().position = new Vector3(-1f, 0f, -0.1f);
        GetComponent <Transform> ().position      = new Vector3(1f, 0.03f, -0.1f);
        wonRevengeGame = false;
        var pickups = GameObject.FindGameObjectsWithTag("Pickup");

        foreach (var pickup in pickups)
        {
            pickup.gameObject.GetComponent <Renderer>().enabled = true;
        }

        string[] conversation = new string[] {
            "OTHER: Hey friend, what's wrong?",
            "YOU: I had the worst dream", "YOU: Carrots were out to get me",
            "OTHER: That was no dream",
            "YOU: What.. *stammer* what do you mean?",
            "OTHER: You have done us a great wrong", "OTHER: Eaten my children without remorse",
            "OTHER: Now I will make you suffer"
        };
        ShowTextForSeconds(conversation, 1.2f, new Vector3(0f, 1f, -0.5f), "kingTransform");
    }
Exemplo n.º 3
0
 void kingTransform()
 {
     canMove = true;
     King.GetComponent <KingScript> ().Transformation();
 }