Пример #1
0
 private void PlayMoveSound()
 {
     if (ActiveElements.GetActiveToppings(position).Any(s => Collide(s)))
     {
         Sound.PlaySound(SoundType.Walking);
     }
 }
Пример #2
0
        private void ApplyGravity()
        {
            var touchesFluid = ActiveElements.GetActiveFluids(position).Any(s => Collide(s));

            if (moveDefiner.key(command.Jump) && Grounded)
            {
                Grounded = false;

                speed = touchesFluid ? Parameters.WaterJumpSpeed : Parameters.MaxFallSpeed;
            }
            foreach (var block in ActiveElements.GetActiveToppings(position))
            {
                if (Collide(block) && TicksElapsed >= Parameters.BlocksCollisionDelay)
                {
                    Grounded = true;
                    if (speed < 0)
                    {
                        speed = 0;
                    }
                    status.DealDamage(DistanceFalled);
                    DistanceFalled = 0;
                    break;
                }
            }
            move(roation.Up, speed);
            ChangeMoveSpeed(touchesFluid);
        }