Exemplo n.º 1
0
 void CheckForGlide()
 {
     if (Input.GetButton("Glide") && !grounded && glideTimer > 0)
     {
         playerState = MovmentState.glide;
         //Velocity.y = 0;
     }
 }
Exemplo n.º 2
0
    void checkForJump()
    {
        float jump = Input.GetAxisRaw("Vertical");

        if (Input.GetButtonDown("Vertical") && jump > 0)
        {
            playerState = MovmentState.jump;
            Velocity.x  = 0;
        }
    }
Exemplo n.º 3
0
 void checkIfGrounded()
 {
     if (transform.position.y <= 0)
     {
         transform.position = new Vector3(transform.position.x, floorLock, 0);
         Velocity.y         = 0;
         grounded           = true;
         playerState        = MovmentState.run;
         glideTimer         = GLIDE_TIME;
     }
 }
Exemplo n.º 4
0
    void DoGlide()
    {
        glideTimer -= Time.deltaTime;

        if (transform.position.y < 2.5)
        {
            DoJump();
        }
        else if (Velocity.y != 0)
        {
            Velocity.y = 0;
        }

        HorisontalMovment();

        if (glideTimer <= 0 || !Input.GetButton("Glide"))
        {
            playerState = MovmentState.jump;
        }
    }
Exemplo n.º 5
0
 void Start()
 {
     playerState = MovmentState.run;
     glideTimer  = GLIDE_TIME;
 }