Пример #1
0
    private void OnCollisionEnter2D(Collision2D other)
    {
        if (other.gameObject.CompareTag("Player"))
        {
            float height = other.contacts[0].point.y - sRenderer.bounds.center.y;

            if (height > 0)
            {
                OnDeath();
                PlayerManager.instance.Jump(PlayerManager.instance.jumpForce);
                GM.AddCombo(50);
                PlayerManager.instance.ResetAirJump();
            }
            else
            {
                EM.CreateEnemyEffects(transform.position);
                OnDeath();
                GM.RemoveLife();

                /*if(PlayerManager.instance.playerState == States.STATE_ON_FIRE)
                 * {
                 *  OnDeath();
                 * }*/
            }
        }/*else if (other.gameObject.CompareTag("Enemy"))
          * {
          * EM.CreateEnemyEffects(transform.position);
          * }*/
    }
Пример #2
0
 private void OnDeath()
 {
     timer        = 0;
     currentSpeed = speed;
     EM.CreateEnemyEffects(transform.position);
     gameObject.SetActive(false);
 }
Пример #3
0
    public void AirJump()
    {
        Vector2 velocityVector = rb.velocity;

        //velocityVector.y = jumpForce;
        velocityVector.y = PM.jumpForce;
        velocityVector.x = PM.jumpForce / 2;

        /*if (velocityVector.y < PM.jumpForce - 5)
         * {
         *  velocityVector.y = PM.jumpForce;
         * }
         * else
         * {
         *  velocityVector.y += PM.jumpForce / 2;
         * }
         *
         * if (velocityVector.x <= PM.jumpForce / 2)
         * {
         *  velocityVector.x = PM.jumpForce / 2;
         * }*/
        //  velocityVector.y += 0.5f;
        rb.velocity = velocityVector;
        aux.CreateBigFriendlyCircle(transform.position);
        EM.CreateEnemyEffects(transform.position);
    }
Пример #4
0
 private void onDeath()
 {
     /*EM.SetCoinPickUpParticles(transform.position);
      * EM.CreateDisappearingCircle(transform.position);
      * EM.GenerateText("Destruction 25", transform.position);*/
     EM.CreateEnemyEffects(transform.position);
     gameObject.SetActive(false);
 }
Пример #5
0
 private void onDeath()
 {
     if (isHook)
     {
         PM.RemoveGrabbableObject(gameObject);
     }
     EM.CreateEnemyEffects(transform.position);
     gameObject.SetActive(false);
 }
Пример #6
0
    private void OnDeath()
    {
        RemoveCamTarget();

        /*
         * EM.SetCoinPickUpParticles(transform.position);
         * EM.CreateDisappearingCircle(transform.position);
         * EM.GenerateText("Missile 100", transform.position);*/
        GameManager.instance.AddCombo(50);
        EM.CreateEnemyEffects(transform.position);
        gameObject.SetActive(false);
    }
Пример #7
0
 private void OnCollisionEnter2D(Collision2D other)
 {
     if (other.gameObject.tag == "Ground")
     {
         /*if (playerState == States.STATE_CLOSE_TO_GROUND)
          * {
          *      playerState = States.STATE_GROUNDED;
          * }*/
     }
     else if (other.gameObject.CompareTag("Rocks"))
     {
         //EM.GenerateText("Bounce 500", transform.position);
         if (rb.velocity.magnitude > 5)
         {
             EM.CreateEnemyEffects(transform.position);
         }
         //GM.AddCombo(50);
         //ResetAirJump();
     }
 }