Exemplo n.º 1
0
        public override void Initialize()
        {
            base.Initialize();

            IdleEffects();
            Speed = Vector2.Zero;
            Direction = Direction.Right;
        }
Exemplo n.º 2
0
        private Vector2 CalculateSpeedOnDirection(Direction direction, GameTime gameTime)
        {
            float time = gameTime.GetElapsedSeconds();
            Vector2 accel = direction.Acceleration;

            if (mobile.State == HitBoxState.Airborne)
            {
                accel.X /= MagicNumbers.AerialAccelerationPenaltyOnX;
            }

            Vector2 velocity = accel * direction * (float)Math.Pow(time, MagicNumbers.GameSpeedPower);
            return velocity;
        }
Exemplo n.º 3
0
 private void ToggleDirection()
 {
     if (Direction == Direction.Right)
     {
         Direction = Direction.Left;
     }
     else
     {
         Direction = Direction.Right;
     }
 }