예제 #1
0
        // Move horizontally
        public new void HorizontalMovement(float targetSpeed)
        {
            Physics physics = GetComponent <Physics>();

            physics.Velocity.X = GameMath.Approach(physics.Velocity.X, targetSpeed, physics.Grounded ? .25f : .15f);
            GetComponent <Sprite>().FlipSprite = targetSpeed < 0;
        }
예제 #2
0
        // Move horizontally
        public void HorizontalMovement(float targetSpeed)
        {
            physics.Velocity.X = GameMath.Approach(physics.Velocity.X, targetSpeed, physics.Grounded ? accelerationSpeed : airAccelerationSpeed);

            if (SpriteManager.GetCurrentSprite() != spriteWalking)
            {
                SpriteManager.ChangeSprite("spriteWalking");
                spriteWalking.ImageIndex = 0;
            }
            SpriteManager.ChangeFlipOnAllSprites(targetSpeed < 0);
        }
예제 #3
0
 // Stop this lmao
 public void StopMoving()
 {
     physics.Velocity.X = GameMath.Approach(physics.Velocity.X, 0, physics.Grounded ? slowDownSpeed : airSlowDownSpeed);
     SpriteManager.ChangeSprite("spriteIdle");
 }
예제 #4
0
        //Stop this lmao
        public new void StopMoving()
        {
            Physics physics = GetComponent <Physics>();

            physics.Velocity.X = GameMath.Approach(physics.Velocity.X, 0, physics.Grounded ? .15f : .1f);
        }