Ejemplo n.º 1
0
    //public void Slide (string text, string name, bool left){
    public void TextNameDirection(string textnamedirection)
    {
        string[] words = textnamedirection.Split(char.Parse("+"));
        //textnamedirection.Split (" ");

        string text = words [0];
        string name = words [1];
        bool   left;

        BBoxScript.ClearTextHolder();
        if (words [2].Equals("left"))
        {
            left = true;
        }
        else
        {
            left = false;
        }
        GameManager.TextNumber++;


        if (left == true)
        {
            BBoxScript.setLeftPictureName(name);
        }
        else
        {
            BBoxScript.setRightPictureName(name);
            BBoxScript.SwitchBoxDirection();
            //Debug.Log (left);
        }

        BBoxScript.Slide(text);
    }
Ejemplo n.º 2
0
    void OnTriggerEnter(Collider other)
    {
        if (ControllerScript.getTimeControl() == false)
        {
            if (other.tag == "enemybody")
            {
                GameObject Root;

                if (other.gameObject.GetComponent <shooter>() == null)
                {
                    Root = other.gameObject.transform.parent.gameObject.transform.parent.gameObject;
                }
                else
                {
                    Root = other.gameObject;
                }



                if (Root.GetComponent <enemyHealth>().getBlinking() == false && Root.GetComponent <enemyHealth>().getDead() == false)
                {
                    if (PlayerAnimator.isAttack1ing == true)
                    {
                        Damage = 3;
                    }
                    else if (PlayerAnimator.isAttack2ing == true)
                    {
                        Damage = 1;

                        PlayerController Script = transform.root.GetComponent <PlayerController>();



                        if (PlayerAnimator.Attack2JumpCount < 3 && ControllerScript.getAttack2Bounce() == false)
                        {
                            Script.Jump();
                            PlayerAnimator.Attack2JumpCount++;
                        }
                    }
                    //Sends the damage
                    Root.SendMessage("takeDamage", Damage, SendMessageOptions.DontRequireReceiver);
                }
            }
            if (other.tag == "Devilchu")
            {
                GameManager.Scene       = "Field Extra 2";
                GameManager.EventNumber = 0;

                BBoxScript.Slide("OWWW!! HEY! That actually really hurt!!!");
                BBoxScript.setLeftPictureName("Devilchu");

                BBoxScript.ActivateEmoticon("Devilchu", "Angry", false);
            }
            if (other.tag == "Breakable")
            {
                if (other.GetComponent <BreakableGround>() != null)
                {
                    BreakableGround BGroundScript = other.GetComponent <BreakableGround>();
                    if (BGroundScript.getisAlive() == true)
                    {
                        BGroundScript.Explode();
                    }
                }
                else if (other.GetComponent <BlockCollider2>() != null)
                {
                    BreakableGroundGravity BGroundScript = other.transform.parent.gameObject.GetComponent <BreakableGroundGravity>();
                    if (BGroundScript.getisAlive() == true)
                    {
                        BGroundScript.TakeDamage();
                    }
                }
            }
        }
    }
Ejemplo n.º 3
0
    void OnTriggerEnter(Collider other)
    {
        if (GameManager.EnableTriggers == true && ControllerScript.getTimeControl() == false)
        {
            if (CameraEventTrigger)
            {
                if (other.tag == "Player")
                {
                    if (GameManager.Location == "Castle")
                    {
                        GameManager.CutsceneEnabled = true;
                        PlayerController.canControl = false;


                        CameraScript.setEventTrigger(true);
                        isActive = false;



                        if (GameManager.Scene == "Castle 1")
                        {
                            DisableForCutScene();
                            AnimatorScript.IdleInstance();
                            HealthScript.HideHearts();


                            StartCoroutine(PauseAndOpenTextBox("Oh ho, so you've arrived!", false, "The Masked Man"));
                            GameManager.Scene = "Castle 1";
                            //	CameraAnimator.WalkToCutscene = true;
                        }
                    }

                    if (GameManager.Location == "Field")
                    {
                        if (TriggerNumber == 3)
                        {
                            GameManager.CutsceneEnabled = true;
                            GameManager.Scene           = "Field Leafree";
                            PlayerController.canControl = false;
                            AnimatorScript.IdleInstance();
                            DisableForCutScene();

                            CameraScript.setEventTrigger(true);
                            HealthScript.HideHearts();

                            isActive = false;
                            GameManager.EventNumber = 1;
                            StartCoroutine(PauseAndOpenTextBox("Hey Devichi!", false, "Leafree"));
                        }
                    }
                }
            }
            else if (TextEventTrigger)
            {
                if (other.tag == "Player")
                {
                    if (isActive == true)
                    {
                        if (GameManager.Location == "Field")
                        {
                            //Step on Devilchu's Head
                            if (TriggerNumber == 1)
                            {
                                //Debug.Log("TEST2");
                                //if (BBoxScript.getisOpen() == false){
                                //	Debug.Log("TEST");
                                GameManager.Scene       = "Field Extra 1";
                                GameManager.EventNumber = 0;
                                BBoxScript.setLeftPictureName("Devilchu");
                                BBoxScript.Slide("AHHHH!! Why are you jumping on my head???");
                                BBoxScript.ActivateEmoticon("Devilchu", "Angry", false);
                                //}
                            }

                            if (TriggerNumber == 2)
                            {
                                //GameManager.CutsceneEnabled = true;
                                PlayerController.canControl = false;
                                //	PlayerController.vel.x = 0.0f;
                                AnimatorScript.RunningInstance(true);
                                GameManager.Scene       = "Field 2";
                                GameManager.EventNumber = 1;
                            }
                        }
                        if (GameManager.Location == "CaveCutscene")
                        {
                            if (TriggerNumber == 2)
                            {
                                PlayerController.vel.x = 0.0f;
                                GameManager.Scene      = "OntoCaveCutscene 4";
                                StartCoroutine(DelayFadeIn());
                                //	Debug.Log ("Bslkdjfklsf");
                            }
                        }



                        if (OnGroundOnly == false)
                        {
                            if (DisableOnTrigger)
                            {
                                Destroy(gameObject);
                            }
                        }
                    }
                }
            }
        }
    }
Ejemplo n.º 4
0
    // Update is called once per frame
    void Update()
    {
        //Debug.Log (GameManager.EventNumber);
        if (EnabledTriggers == true)
        {
            EnableTriggers = true;
        }
        else
        {
            EnableTriggers = false;
        }


        if (isFadingIn)
        {
            if (FadeIn + 0.015f < 1.0f)
            {
                FadeIn += 0.015f;
                CutsceneBlue.GetComponent <GUITexture>().color = new Color(FadeColour, FadeColour, FadeColour, FadeIn);
            }
            else
            {
                EventNumber++;
                isFadingIn = false;
            }
        }

        if (isFadingOut)
        {
            if (FadeIn - 0.015f > 0)
            {
                FadeIn -= 0.015f;
                CutsceneBlue.GetComponent <GUITexture>().color = new Color(FadeColour, FadeColour, FadeColour, FadeIn);
            }
            else
            {
                EventNumber++;
                isFadingOut = false;
                CutsceneBlue.GetComponent <GUITexture>().enabled = false;
            }
        }

        if (FadeInAndOut == true)
        {
            if (CutsceneBlue.GetComponent <GUITexture>().enabled == false)
            {
                CutsceneBlue.GetComponent <GUITexture>().enabled = true;
                FadeIn = 0.0f;
                CutsceneBlue.GetComponent <GUITexture>().color = new Color(1f, 1f, 1f, FadeIn);
                Whiten = true;
            }
            if (Whiten == true)
            {
                if (FadeIn + 0.015f < 1.0f)
                {
                    FadeIn += 0.015f;
                    CutsceneBlue.GetComponent <GUITexture>().color = new Color(1f, 1f, 1f, FadeIn);
                }
                else
                {
                    //DO SOMETHING....
                    Whiten = false;
                }
            }
            if (Whiten == false)
            {
                if (FadeIn - 0.015f > 0)
                {
                    FadeIn -= 0.015f;
                    CutsceneBlue.GetComponent <GUITexture>().color = new Color(1f, 1f, 1f, FadeIn);
                }
                else
                {
                    EventNumber++;
                    TextNumber++;
                    CutsceneBlue.GetComponent <GUITexture>().enabled = false;
                    FadeInAndOut = false;
                }
            }
        }

        if (Location == "Field")
        {
            if (Scene == "Field 1")
            {
                if (EventNumber == 0)
                {
                    if (FadeIn - 0.015f > 0)
                    {
                        FadeIn -= 0.015f;
                        CutsceneBlue.GetComponent <GUITexture>().color = new Color(1f, 1f, 1f, FadeIn);
                    }
                    else
                    {
                        CutsceneBlue.GetComponent <GUITexture>().enabled = false;
                        EventNumber++;

                        //BlackBoxScript.SpeedAble = true;
                        BBScript.setLeftPictureName("Devilchu");
                        BBScript.setRightPictureName("Devichi");
                        BBScript.Slide("...And that is why apples are factually the superior fruit!~");
                        BBScript.ActivateEmoticon("Devilchu", "Happy", false);
                    }
                }
                else if (EventNumber == 1)
                {
                }
            }
        }

        if (Location == "FieldCutscene")
        {
            if (Scene == "FieldCutscene 1")
            {
                if (EventNumber == 1)
                {
                    BBScript.Slide("Hey you!");
                    BBScript.setRightPictureName("Leafree");
                    BBScript.SwitchBoxDirection();
                    EventNumber++;
                    //TextNumber = EventNumber;
                }
                if (EventNumber == 9)
                {
                    Scene = "FieldCutscene 2";
                    MyAnimation.Play("FieldLeafree 2", 0, 0.0f);
                    EventNumber++;
                }
            }
            if (Scene == "FieldCutscene 2")
            {
                if (EventNumber == 15)
                {
                    Scene       = "FieldCutscene 3";
                    EventNumber = 0;
                    TextNumber  = 0;

                    MyAnimation.Play("FieldLeafree 3", 0, 0.0f);
                }
            }
        }
    }
Ejemplo n.º 5
0
    void OnTriggerStay(Collider other)
    {
        if (other.tag == "Player")
        {
            if (BBoxScript.getisOpen() == false)
            {
                if (Sign == "Jump")
                {
                    GameManager.Scene       = "Sign 1";
                    GameManager.EventNumber = 0;
                    BBoxScript.setLeftPictureName("Sign-san");
                    BBoxScript.Slide("Press the Up Arrow to jump!!!");
                }
                else if (Sign == "Attack")
                {
                    GameManager.Scene       = "Sign 2";
                    GameManager.EventNumber = 0;
                    BBoxScript.setLeftPictureName("Sign-san");
                    BBoxScript.Slide("Press the Z key to attack the leaf monsters!!!");
                }
                else if (Sign == "JumpAttack")
                {
                    GameManager.Scene       = "Sign 3";
                    GameManager.EventNumber = 0;
                    BBoxScript.setLeftPictureName("Sign-san");
                    BBoxScript.Slide("Press Z while jumping to do a spinning attack!");
                }
                else if (Sign == "JumpAttackX3")
                {
                    GameManager.Scene       = "Sign 4";
                    GameManager.EventNumber = 0;
                    BBoxScript.setLeftPictureName("Sign-san");
                    BBoxScript.Slide("You bounce when you do your jump attack. You can bounce up to 3 times before you have to land again.");
                }

                else if (Sign == "WallClimb")
                {
                    GameManager.Scene       = "Sign 5";
                    GameManager.EventNumber = 0;
                    BBoxScript.setLeftPictureName("Sign-san");
                    BBoxScript.Slide("You can climb blocks with paw-prints by holding the direction of the block (left/right), and pressing jump (up).");
                }
                else if (Sign == "WallJump")
                {
                    GameManager.Scene       = "Sign 6";
                    GameManager.EventNumber = 0;
                    BBoxScript.setLeftPictureName("Sign-san");
                    BBoxScript.Slide("Wall climb back and forth to {w{a{l{l{-{j{u{m{p. Wall-jumping is a bit faster than climbing, but it takes some practice.");
                }
                else if (Sign == "WallJump 2")
                {
                    GameManager.Scene       = "Sign 7";
                    GameManager.EventNumber = 0;
                    BBoxScript.setLeftPictureName("Sign-san");
                    BBoxScript.Slide("You can jump A LOT further horizontally by wall jumping compared to jumping regularly!");
                }
                else if (Sign == "Obstacles")
                {
                    GameManager.Scene       = "Sign 8";
                    GameManager.EventNumber = 0;
                    BBoxScript.setLeftPictureName("Sign-san");
                    BBoxScript.Slide("Some deadly obstacles, such as spikes and saws, result in <i<n<s<t<a<n<t <d<e<a<t<h on contact.");
                }
            }
        }
    }
Ejemplo n.º 6
0
    void FixedUpdate()
    {
        if (Time.time > j + 1)
        {
            j = Time.time;

            k = 0;
        }
        else
        {
            k++;
        }


        if (GameManager.CutsceneEnabled == false)
        {
            isGroundedTimeControl(IsGroundedList);
            ExternalForceTimeControl(ExternalForceList);
            FlinchTimeControl(isFlinchingList);
            VelocityTimeControl(VelocityList);
            //Position and central time control list
            if (TimeControl == false)
            {
                myList.Add(transform.position);
            }

            if (TimeControl == true)
            {
                if (AutomatedTimeControl == true && TimeControlGrounded == true && AutomatedTimer == false)                   //&& transform.position.x <= SpawnPoint.x){
                {
                    AutomatedTimeControl = false;
                    vel.x       = 0.0f;
                    TimeControl = false;
                    canControl  = true;
                    Vision.GetComponent <SpriteRenderer> ().enabled = false;
                    TimeSpeed      = 1.0f;
                    Time.timeScale = 1.0f;

                    if (GameManager.Scene == "Field 2" && GameManager.EventNumber == 1 && AutomatedTimer == false)
                    {
                        canControl = false;
                        GameManager.CutsceneEnabled = true;
                        BBScript.setLeftPictureName("Devichi");
                        GameManager.EventNumber++;
                        BBScript.Slide("...!!! I thought I was a goner... What was that?");
                    }
                }


                transform.position = myList [myList.Count - 1];
                myList.RemoveAt(myList.Count - 1);
                if (AutomatedTimeControl == false)
                {
                    if (TimeSpeed < 3.0f)
                    {
                        if (Time.time > initTime + 3.0f)
                        {
                            TimeSpeed += 0.02f;
                        }
                        if (TimeSpeed < 1.0f)
                        {
                            TimeSpeed += 0.01f;
                        }
                    }
                    else
                    {
                        TimeSpeed += 0.001f;
                    }
                    Time.timeScale = TimeSpeed;
                }
                if (myList.Count == 0)
                {
                    TimeControl = false;
                    canControl  = true;
                    Vision.GetComponent <SpriteRenderer> ().enabled = false;
                    Time.timeScale = 1.0f;
                    TimeSpeed      = 1.0f;
                }
            }

            //Velocity Time control Lists
            //
        }
    }