Esempio n. 1
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()
    {
        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;
        }
    }
Esempio n. 4
0
 public void Dash()
 {
     player.Dash();
 }