Пример #1
0
 public override void UpdateFrameList()
 {
     if (_collapsing)
     {
         CharacterSprite.SetFrameList("collapsing");
     }
     else if (_preparingDash)
     {
         CharacterSprite.SetFrameList("dash_preparation");
     }
     else if (_isDashing)
     {
         CharacterSprite.SetFrameList("dash_attack");
     }
     else if (_isAttacking)
     {
         CharacterSprite.SetFrameList(_attackFrameList[_attackType]);
     }
     else if (CharacterSprite.ImmunityAnimationActive)
     {
         CharacterSprite.SetIfFrameListExists("damage");
     }
     else if (!_isOnGround)
     {
         CharacterSprite.SetIfFrameListExists("jumping");
     }
     else
     {
         CharacterSprite.SetFrameList("stand");
     }
 }
 private void InitWheelMode(float targetX)
 {
     _movementSide   = Math.Sign(targetX - Position.X);
     _movement       = 0f;
     _acceleration   = 0f;
     _enterWheelMode = true;
     _velocity.Y     = -1000f;
     CharacterSprite.SetFrameList("enter_wheel_mode");
 }
 private void UpdateEnterWheel()
 {
     if (CharacterSprite.CurrentFrameList == "enter_wheel_mode" && CharacterSprite.Looped)
     {
         _enterWheelMode = false;
         _wheelMode      = true;
         _wheelTick      = InitialWheelTime;
         CharacterSprite.SetFrameList("wheel_mode");
         _emitSparkTime = 800f;
     }
 }
Пример #4
0
 public virtual void UpdateFrameList()
 {
     if (_dying)
     {
         CharacterSprite.SetIfFrameListExists("dying");
     }
     else if (CharacterSprite.ImmunityAnimationActive)
     {
         CharacterSprite.SetIfFrameListExists("damage");
     }
     else if (_isAttacking)
     {
         CharacterSprite.SetFrameList(_attackFrameList[_attackType]);
     }
     else if (!_isOnGround)
     {
         CharacterSprite.SetFrameList("jumping");
     }
     else
     {
         CharacterSprite.SetFrameList("stand");
     }
 }
Пример #5
0
 public override void UpdateFrameList()
 {
     if (_dying)
     {
         CharacterSprite.SetIfFrameListExists("dying");
     }
     else if (CharacterSprite.ImmunityAnimationActive)
     {
         CharacterSprite.SetIfFrameListExists("damage");
     }
     else
     {
         CharacterSprite.SetFrameList("stand");
     }
 }
Пример #6
0
 public override void RequestAttack(int type)
 {
     if (type == Dash)
     {
         _preparingDash = true;
         CharacterSprite.SetFrameList("dash_preparation");
     }
     else
     {
         if (type == Cannonballs)
         {
             CreateCannonballs();
         }
         base.RequestAttack(type);
     }
 }
Пример #7
0
 public override void UpdateFrameList()
 {
     CharacterSprite.IsVisible = !_onHole;
     if (_dying)
     {
         CharacterSprite.SetFrameList("dying");
     }
     else if (!_isOnGround)
     {
         var frameList = _velocity.Y == 0 ? "jump_zero" : _velocity.Y > 0 ? "jump_down" : "jump_up";
         CharacterSprite.SetFrameList(frameList);
     }
     else if (_stuckOnGroud)
     {
         CharacterSprite.SetFrameList("stuck");
     }
 }
 public override void PlayerOnSight(Vector2 playerPosition)
 {
     if (Position.X - playerPosition.X > 0)
     {
         CharacterSprite.Effect = SpriteEffects.FlipHorizontally;
     }
     else
     {
         CharacterSprite.Effect = SpriteEffects.None;
     }
     if (!_alertAnimation && !_isAttacking)
     {
         _alertAnimation    = true;
         _viewRangeCooldown = 1500f;
         CharacterSprite.SetFrameList("alert");
     }
 }
Пример #9
0
 public override void UpdateFrameList()
 {
     if (_confusionTick > 0f)
     {
         CharacterSprite.SetFrameList("confusion");
     }
     else if (_enterWheelMode)
     {
         CharacterSprite.SetFrameList("enter_wheel_mode");
     }
     else if (_wheelMode)
     {
         CharacterSprite.SetFrameList("wheel_mode");
     }
     else
     {
         base.UpdateFrameList();
     }
 }
 public override void UpdateFrameList()
 {
     if (!_dying && !CharacterSprite.ImmunityAnimationActive)
     {
         if (_confusionTick > 0f)
         {
             CharacterSprite.SetFrameList("confusion");
         }
         else if (_enterWheelMode)
         {
             CharacterSprite.SetFrameList("enter_wheel_mode");
         }
         else if (_wheelMode)
         {
             CharacterSprite.SetFrameList("wheel_mode");
         }
     }
     else
     {
         base.UpdateFrameList();
     }
 }
Пример #11
0
        public override void UpdateFrameList()
        {
            // Main Sprite
            if (_dying)
            {
                CharacterSprite.SetIfFrameListExists("dying");
            }
            else if (_isAttacking)
            {
                CharacterSprite.SetFrameList(_attackFrameList[_attackType]);
            }
            else if (_recharging)
            {
                CharacterSprite.SetFrameList("recharging");
            }
            else if (_groundImpact)
            {
                CharacterSprite.SetFrameList("jumping_impact");
            }
            else if (!_isOnGround)
            {
                if (Math.Abs(_velocity.Y) < 100.0f || _velocity.Y > 0)
                {
                    CharacterSprite.SetFrameList("jumping_apex");
                }
                else
                {
                    CharacterSprite.SetFrameList("jumping");
                }
            }
            else if (WalkingByInput())
            {
                CharacterSprite.SetFrameList("walking");
            }
            else
            {
                CharacterSprite.SetFrameList("stand");
            }

            // Bottom sprite specials motions
            if (!_isOnGround)
            {
                if (Math.Abs(_velocity.Y) < 100.0f || _velocity.Y > 0)
                {
                    _bottomSprite.SetFrameList("jumping_apex");
                }
                else
                {
                    _bottomSprite.SetFrameList("jumping");
                }
            }
            else if (_recharging && !WalkingByInput())
            {
                _bottomSprite.SetFrameList("recharging");
            }
            else if (_groundImpact && !_recharging)
            {
                _bottomSprite.SetFrameList("jumping_impact");
            }
            else if (WalkingByInput())
            {
                _bottomSprite.SetFrameList("walking");
            }
            else if (_isAttacking)
            {
                _bottomSprite.SetFrameList(_attackFrameList[_attackType]);
            }
            else
            {
                _bottomSprite.SetFrameList("stand");
            }
        }