Move() public method

public Move ( float move, float moveUpDown, bool crouch, bool jump ) : void
move float
moveUpDown float
crouch bool
jump bool
return void
    private void FixedUpdate()
    {
        // Read the inputs.
        bool  crouch = Input.GetKey(KeyCode.LeftShift);
        float h      = CrossPlatformInputManager.GetAxis("Horizontal");

        // Pass all parameters to the character control script.
        m_Character.Move(h, crouch, m_Jump);


        if (h != 0 || m_Jump == true)
        {
            timeSinceAction = Time.time;
            anim.SetBool("Hello", false);
            anim.SetBool("Gratte", false);
        }

        if (m_Jump == true)
        {
            StartCoroutine(LaunchAnim(0.5f, "Jump"));
        }

        if (Time.time - timeSinceAction >= 2.5f && !busy)
        {
            LaunchIdleAnim();
        }

        m_Jump = false;
    }
Esempio n. 2
0
 void FixedUpdate()
 {
     if (!basePlayer.IsDead)
     {
         m_Character.Move(h, v);
     }
 }
Esempio n. 3
0
    //FixedUpdate for physics
    private void FixedUpdate()
    {
        float moveHorizontal = Input.GetAxis("Horizontal");

        charScript.Move(moveHorizontal, isJumping);
        isJumping = false;
    }
Esempio n. 4
0
    void FixedUpdate()
    {
        bool crouch = Input.GetKey(KeyCode.LeftControl);

        character2D.Move(GetDirection(), crouch, isJumping);
        isJumping = false;
    }
Esempio n. 5
0
    private void FixedUpdate()
    {
        var h = CrossPlatformInputManager.GetAxis("Horizontal");

        character.Move(h, isJumping);
        isJumping = false;
    }
    private void FixedUpdate()
    {
        float h = CrossPlatformInputManager.GetAxisRaw("Horizontal");

        m_Character.Move(h, m_Jump);
        m_Jump = false;
    }
Esempio n. 7
0
    void FixedUpdate()
    {
        if (player == null)
        {
            return;
        }

        bool crouch = false;
        bool jump   = false;

        float deltaX = player.transform.position.x - transform.position.x;
        float dist   = Mathf.Abs(deltaX);

        float h = sign(deltaX);

        if (dist >= idleDist)
        {
            h = 0;
        }
        else if (dist <= atkDist)
        {
            h = 0;
            tryToAtk();
        }

        character.Move(h, crouch, jump);
    }
Esempio n. 8
0
    private void FixedUpdate()
    {
        //move the player with the correct recored values
        player.Move(X, m_Jump);
        player.Dash(m_Dash);


        //pause or unpause the game
        //TODO implement the pause into replay
        // menu.paused = m_Pause;

        //check if XPos and YPos are NOT ZERO
        //if so, make a correction
        if (XPos != 0 || YPos != 0)
        {
            player.m_Rigidbody2D.velocity = Vector2.zero;
            player.Correction(targetPos, X);
            updatePos();
        }


        m_Jump = false;
        m_Dash = false;

        //if x seconds have passed
        ////then get the current player position and write it to a file
        //if (Time.time > nextActionTime)
        //{
        //    nextActionTime += peroid;
        //    StartCoroutine(Sync());
        //}
    }
    private void FixedUpdate()
    {
        // Read the inputs.
        bool run = Input.GetKey(KeyCode.LeftShift);

        if (!run)
        {
            run = (Input.GetAxis("Xbox360ControllerTriggers") > 0);
        }

        //float h = CrossPlatformInputManager.GetAxis("Horizontal");
        float h = 0.0f;

        //When player moves
        if (Mathf.Abs(Input.GetAxis("Xbox360ControllerLeftAnalogX")) > 0.5f || Mathf.Abs(Input.GetAxis("Horizontal")) > 0.0f)
        {
            h = 1.0f * Mathf.Sign(Input.GetAxis("Xbox360ControllerLeftAnalogX"));
            if (Mathf.Abs(Input.GetAxis("Horizontal")) > 0.0f)
            {
                h = Input.GetAxis("Horizontal");                           //Keyboard
            }

            currentTime -= Time.deltaTime;
            if (currentTime <= 0)
            {
                character.cameraFollow.SendMessage("ToggleSmoothTimeX", false);
                if (!run)
                {
                    character.cameraFollow.SendMessage("ToggleWalkOffsetX", true);
                }
                else
                {
                    character.cameraFollow.SendMessage("ToggleRunOffsetX", true);
                }
            }
        }
        else
        {
            character.cameraFollow.SendMessage("ToggleSmoothTimeX", true);
            character.cameraFollow.SendMessage("ToggleWalkOffsetX", false);
            currentTime = maxTime;
        }
        // Pass all parameters to the character control script.

        /*
         * if(Input.GetKey("right") || Input.GetKey("left")){
         *      timer -= Time.deltaTime;
         *      if (timer <= 0) {
         *              print ("10sec");
         *      }
         * }
         * if (Input.GetKeyUp ("right") || Input.GetKeyUp ("left")) {
         *      timer = 2.0f;
         * }
         */

        character.Move(h, run, jump);
        jump = false;
    }
Esempio n. 10
0
 private void FixedUpdate()
 {
     // Read the inputs.
     //bool crouch = Input.GetKey(KeyCode.LeftControl);
     // Pass all parameters to the character control script.
     m_Character.Move(horizontalInput, false, m_Jump);
     m_Jump = false;
 }
Esempio n. 11
0
    private void FixedUpdate()
    {
        bool crouch = Input.GetKey(KeyCode.LeftControl);

        // Pass all parameters to the character control script.
        m_Character.Move(horizontalMove, crouch);
        m_Character.Jump(m_Jump);
    }
Esempio n. 12
0
    private void FixedUpdate()
    {
        bool  crouch = Input.GetKey(KeyCode.LeftControl);
        float h      = CrossPlatformInputManager.GetAxis("Horizontal");

        character.Move(h, crouch, jump);
        jump = false;
    }
    void FixedUpdate()
    {
        Vector2 move = InputManager.ActiveDevice.LeftStick;

        character.Move(move, jump, punch);
        jump  = false;
        punch = false;
    }
Esempio n. 14
0
    private void FixedUpdate()
    {
        // Read the inputs.
        float h = CrossPlatformInputManager.GetAxis("Horizontal");

        // Pass all parameters to the character control script.
        m_Character.Move(h, false, m_Jump);
        m_Jump = false;
    }
Esempio n. 15
0
 private void FixedUpdate()
 {
     // Read the inputs.
     //bool crouch = Input.GetKey(KeyCode.LeftControl);
     //float h = CrossPlatformInputManager.GetAxis("Horizontal");
     // Pass all parameters to the character control script.
     controller.Move(1, false, m_Jump);
     m_Jump = false;
 }
Esempio n. 16
0
    private void FixedUpdate()
    {
        float h = 1;

        m_Character.Move(h, extremely_Jump, beast_Jump, m_Jump);
        m_Jump         = false;
        extremely_Jump = false;
        beast_Jump     = false;
    }
Esempio n. 17
0
    private void FixedUpdate()
    {
        // Read the inputs.
        bool  crouch = Input.GetKey(KeyCode.LeftControl);
        float h      = Input.GetAxis("Horizontal");

        // Pass all parameters to the character control script.
        m_Character.Move(h, crouch, m_Jump);
        m_Jump = false;
    }
    public void FixedUpdate()
    {
        // Read the inputs.
        bool  crouch = Input.GetKey(KeyCode.LeftControl);
        float h      = CrossPlatformInputManager.GetAxis("Horizontal");

        // Pass all parameters to the character control script.
        character.Move(h, crouch, jump);
        jump = false;
    }
    private void FixedUpdate()
    {
        // Read the inputs.
        bool  crouch = _inputButtonCrouch;
        float h      = joystick.GetAxis("Horizontal");    //CrossPlatformInputManager.GetAxis("Horizontal");

        // Pass all parameters to the character control script.
        m_Character.Move(h, crouch, m_Jump);
        m_Jump = false;
    }
Esempio n. 20
0
    void Update()
    {
        /* Reminder about random chances.
         * float randValue = Random.value;
         * if (randValue < .45f) // 45% of the time
         * {
         *  // Do Normal Attack 1
         * }
         * else if (randValue < .9f) // 45% of the time
         * {
         *  // Do Normal Attack 2
         * }
         * else // 10% of the time
         * {
         *  // Do Special Attack
         * }
         */

        if (enableSimpleAI)
        {
            // If FPS=30, the chance of changing state is 6% per second.
            if (Random.value < .002f)
            {
                SwitchState();
            }

            switch (currentState)
            {
            case State.Idle:
                m_Character.Move(0, false, false);
                break;

            case State.Wandering:
                m_Character.Move(moveSpeed * walkDirection, false, false);
                break;

            case State.Seeking:
                // Player seeking.
                break;
            }
        }
    }
    private void FixedUpdate()
    {
        // Read the inputs.
        bool crouch = Input.GetKey(KeyCode.LeftControl);

        float h = CrossPlatformInputManager.GetAxis(horizontalAxisButton);

        // Pass all parameters to the character control script.
        m_Character.Move(h, crouch, m_Jump, m_jumpPower);
        m_Jump = false;
    }
    void FixedUpdate()
    {
        // Read the inputs.
        bool crouch = Input.GetKey(KeyCode.LeftControl);

        // Pass all parameters to the character control script.
        character.Move(crouch, jump);

        // Reset the jump input once it has been used.
        jump = false;
    }
Esempio n. 23
0
 private void FixedUpdate()
 {
     Crouch = CnInputManager.GetButton("Crouch");
     h      = CnInputManager.GetAxis("Horizontal");
     // Pass all parameters to the character control script.
     if (!GameController.isGameOver)
     {
         Character.Move(h, Crouch, Jump);
     }
     Jump = false;
 }
    void FixedUpdate()
    {
        // Read the inputs.
        bool crouch = Input.GetKey(KeyCode.LeftControl);

        float h = Input.GetAxis("Horizontal");

        if (game_uGUI.current_game_uGUI.allow_game_input)                //new condition for mobile menu kit
        {
            // Pass all parameters to the character control script.
            character.Move(h, crouch, jump);
        }
        else
        {
            character.Move(0, false, false);
        }


        // Reset the jump input once it has been used.
        jump = false;
    }
Esempio n. 25
0
    private void Update()
    {
        InterpreteKeys();
        TintOnCharge();
        ThirdChageBehavior();

        crouch = Input.GetKey(KeyCode.DownArrow);
        h      = Input.GetAxisRaw("Horizontal");

        m_Character.Move(h, crouch, m_Jump);
        m_Jump = false;
    }
Esempio n. 26
0
    public void LoadLastCheckpoint()
    {
        deaths = deaths++;
        reset  = true;
        GameObject.FindWithTag("Player").transform.position = lastCheckpoint;


        m_Character.Move(0, false, false);

        GameObject.FindWithTag("Player").GetComponent <PlatformerCharacter2D>().enabled   = false;
        GameObject.FindWithTag("Player").GetComponent <Platformer2DUserControl>().enabled = false;
        StartCoroutine("WaitForGround");
    }
    private void FixedUpdate()
    {
        CoolDStamFunc();
        bool crouch = Input.GetKey(KeyCode.LeftControl);

        h = CrossPlatformInputManager.GetAxis("Horizontal");
        if (StamFull)
        {
            Run = Input.GetKey(KeyCode.LeftShift);
        }
        m_Character.Move(h, Run, crouch, m_Jump);
        m_Jump = false;
    }
    private void FixedUpdate()
    {
        // Read the inputs.
        bool  crouch = Input.GetKey(KeyCode.LeftControl);
        bool  roll   = Input.GetKey(KeyCode.X);
        bool  run    = Input.GetKey(KeyCode.LeftShift);
        float h      = CrossPlatformInputManager.GetAxis("Horizontal");
        float v      = CrossPlatformInputManager.GetAxis("Vertical");

        // Pass all parameters to the character control script.
        m_Character.Move(h, v, crouch, roll, m_Jump, run);
        m_Jump = false;
    }
    private void FixedUpdate()
    {
        bool crouch = Input.GetKey(KeyCode.LeftControl);

        //float h = CrossPlatformInputManager.GetAxis("Horizontal");
        horizontalAxis = Input.GetAxis("Horizontal");
        character.Move(horizontalAxis, crouch);

        if (dash)
        {
            character.Dash();
            dash = false;
        }
    }
    private void FixedUpdate()
    {
        if (m_Character.validInput)
        {
            //call the Move and Dash functions located in PlatformerCharacter2D
            m_Character.Move(h, m_Jump);
            m_Character.Dash(m_Dash);


            //reset the bools
            m_Jump = false;
            m_Dash = false;
        }
    }