Beispiel #1
0
    public void ACT()
    {
        Debug.Log("ACT...");
        INFO_HOLDER.Change_Energy_State(5);

        if (is_up_zone_triggered)
        {
            UP();
            is_up_zone_triggered = false;

            Debug.Log("UP...");
        }
        else if (is_run_zone_triggered)
        {
            ACCELERATE();
            is_destroyingRockLand = true; // used for specialLandTrigger
            is_run_zone_triggered = false;
        }
        else if (is_stone_to_drag_triggered)
        {
            PUSH();
            is_stone_to_drag_triggered = false;
        }
        else if (is_crouch_zone_triggered)
        {
            CROUCH();
            is_crouch_zone_triggered = false;
        }
    }
Beispiel #2
0
 public void JUMP()
 {
     if (is_Grounded)
     {
         INFO_HOLDER.Change_Energy_State(1);
         StartCoroutine("JUMP_enum");
     }
 }
Beispiel #3
0
    public void FALL_45()
    {
        if (is_Jumped)
        {
            INFO_HOLDER.Change_Energy_State(2);
            animator.animation.Play("jumpdown"); // ----------------------------------------->
            AudioManager.instance.Play("Fall45");

            if (!is_on_direction_change)
            {
                this_rb.AddForce(new Vector3(-down45_force, -down45_force * 2f, 0));
            }
            else
            {
                this_rb.AddForce(new Vector3(down45_force, -down45_force * 2f, 0));
            }

            INCREMENT_CURRENT_SPEED();
            //challenge_Controller.Land();

            is_fall_pressed = true;
        }
    }
 void Awake()
 {
     instance = this;
 }
Beispiel #5
0
    private void OnTriggerEnter2D(Collider2D collision)
    {
        if (collision.tag == "DEAD_ZONE")
        {
            if (!is_Player_Dead)
            {
                StartCoroutine("DEATH");
            }
        }
        if (collision.tag == "WIN_ZONE")
        {
            if (!is_Player_Dead)
            {
                WIN();
            }
        }
        if (collision.tag == "RUN_TRIGGER")
        {
            if (!is_Player_Dead)
            {
                foreach (var item in acceleration_UI)
                {
                    item.SetActive(true);
                }

                is_run_zone_triggered = true;

                foreach (var rock in collision.gameObject.GetComponentInParent <RockFalling_Land>().rocks)
                {
                    DROP_THE_ROCK(rock);
                }
            }
        }
        if (collision.tag == "CROUCH_TRIGGER")
        {
            if (!is_Player_Dead)
            {
                foreach (var item in acceleration_UI)
                {
                    item.SetActive(true);
                }
                is_crouch_zone_triggered = true;
            }
        }
        if (collision.tag == "SAVE_CLIMB")
        {
            //foreach (var item in acceleration_UI)
            //{
            //    item.SetActive(true);
            //}
            //is_up_zone_triggered = true;
            //upCollidder_buffer = collision;

            //is_Running = false;
            //this_transform.position = upCollidder_buffer.transform.position;
            //this_rb.constraints = RigidbodyConstraints2D.FreezeAll;
            //this_rb.gravityScale = 0f;
            //animator.SetBool("is_Hanged", true);
        }
        if (collision.tag == "CHECKPOINT")
        {
            if (!is_Player_Dead)
            {
                StartCoroutine("Activate_Reward_text", REWARD_FOR_CHECKPOINT);
                CHECKPOINT(collision);
            }
        }
        if (collision.tag == "SHADOW")
        {
            AudioManager.instance.Play("Shadow");
            //challenge_Controller.LandOnShadow();
        }
        if (collision.tag == "EASTER_EGG")
        {
            //challenge_Controller.FindEasterEgg();
        }
        if (collision.tag == "ROLLING_TRIGGER")
        {
            collision.gameObject.GetComponent <RollingBall_Controller>().ActivateObstacle();
        }
        if (collision.tag == "BALL_TRIGGER")
        {
            collision.gameObject.GetComponent <Balls_System>().Activate();
        }
        if (collision.tag == "Energy")
        {
            if (!is_Player_Dead)
            {
                INFO_HOLDER.Change_Energy_State(-5);
                AudioManager.instance.Play("Energy");
                Destroy(collision.gameObject);
            }
        }
    }