示例#1
0
    public void Pular()
    {
        float axisJump = Input.GetAxisRaw(AxisUtils.AXIS_JUMP);

        if (axisJump != 0 && !PlayerPuloCollider.GetEstaPulando())
        {
            Vector2 vetVertical = new Vector2(0, axisJump);
            Player.rb.AddForce(vetVertical * Player.impulsoPulo);
        }
    }
示例#2
0
    public void Andar()
    {
        axisH = Input.GetAxisRaw(AxisUtils.AXIS_HORIZONTAL);

        if (axisH != 0 && !PlayerPuloCollider.GetEstaPulando() && !PlayerParedeCollider.GetEstaNaParede() ||
            axisH != 0 && !PlayerPuloCollider.GetEstaPulando() && PlayerParedeCollider.GetEstaNaParede())
        {
            Vector2 vetHorizontal = new Vector2(axisH * Player.velocidadeMoviemnto, Player.rb.velocity.y);
            Player.rb.velocity = vetHorizontal;
        }
        else if (axisH != 0 && PlayerPuloCollider.GetEstaPulando())
        {
            Vector2 vetHorizontal = new Vector2(axisH, 0);
            Player.rb.AddForce(vetHorizontal * (Player.velocidadeMoviemnto * 2));
        }
    }