当前位置: 首页>>代码示例>>C#>>正文


C# Player.AddAnimationToQueue方法代码示例

本文整理汇总了C#中Player.AddAnimationToQueue方法的典型用法代码示例。如果您正苦于以下问题:C# Player.AddAnimationToQueue方法的具体用法?C# Player.AddAnimationToQueue怎么用?C# Player.AddAnimationToQueue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Player的用法示例。


在下文中一共展示了Player.AddAnimationToQueue方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: OnAttackAction

 public void OnAttackAction(Player.Player player)
 {
     IsDoingAction = true;
     player.AttackSound.Play();
     player.AddAnimationToQueue("punch");
     player.AnimationEnded += OnPunchEnded;
     player.AnimationFrameChanged += OnPunchFrameChange;
     player.SetVelX(0);
 }
开发者ID:DuckKnightDuel,项目名称:Adam,代码行数:9,代码来源:PlayerScript.cs

示例2: OnDashAction

 public void OnDashAction(Player.Player player)
 {
     if (!IsDoingAction)
     {
         IsDoingAction = true;
         float speed = DashSpeed;
         if (player.IsFacingRight)
             speed = -DashSpeed;
         player.SetVelX(speed);
         player.AddAnimationToQueue("ninjaDash");
         player.AnimationEnded += OnNinjaDashEnd;
         TestSmokeParticle.Generate(100, player);
     }
 }
开发者ID:DuckKnightDuel,项目名称:Adam,代码行数:14,代码来源:PlayerScript.cs

示例3: OnDuckAction

 public void OnDuckAction(Player.Player player)
 {
     if (player.IsOnVines)
     {
         OnClimbingDownAction(player);
     }
     player.AddAnimationToQueue("duck");
     _isDucking = true;
 }
开发者ID:DuckKnightDuel,项目名称:Adam,代码行数:9,代码来源:PlayerScript.cs

示例4: OnClimbingUpAction

 public void OnClimbingUpAction(Player.Player player)
 {
     player.AddAnimationToQueue("climb");
     player.SetVelY(-5);
     player.ObeysGravity = false;
 }
开发者ID:DuckKnightDuel,项目名称:Adam,代码行数:6,代码来源:PlayerScript.cs

示例5: OnPunchEnded

        private void OnPunchEnded(Player.Player player)
        {
            player.RemoveAnimationFromQueue("punch");
            player.AnimationEnded -= OnPunchEnded;
            IsDoingAction = false;

            if (TimeSinceLastPunch.TimeElapsedInMilliSeconds < 325)
            {
                player.AttackSound.Play();
                player.AddAnimationToQueue("punch2");
                player.AnimationFrameChanged += OnPunchFrameChange;
                player.AnimationEnded += OnPunch2Ended;
                IsDoingAction = true;
            }
        }
开发者ID:DuckKnightDuel,项目名称:Adam,代码行数:15,代码来源:PlayerScript.cs

示例6: OnStill

        public void OnStill(Player.Player player)
        {
            if (!player.IsOnVines)
            {
                player.RemoveAnimationFromQueue("climb");
            }
            else
            {
                player.RemoveAnimationFromQueue("fall");
            }

            // Toggle idle animations.

            if (_idleTimer.TimeElapsedInSeconds > 10)
            {
                player.AddAnimationToQueue("smellPoop");
                player.AnimationEnded += OnSmellPoopAnimationEnd;
                _idleTimer.Reset();
            }

            if (Math.Abs(player.GetVelocity().X) < 2f)
            {
                player.RemoveAnimationFromQueue("walk");
            }
            if (Math.Abs(player.GetVelocity().X) < 9)
            {
                player.RemoveAnimationFromQueue("run");
            }
            if (Math.Abs(player.GetVelocity().X) < 1)
            {
                player.RemoveAnimationFromQueue("slide");
            }

            if (player.GetVelocity().Y > 2)
            {
                player.IsJumping = true;

                if (player.GetVelocity().Y > 10)
                    player.AddAnimationToQueue("fall");
            }
        }
开发者ID:DuckKnightDuel,项目名称:Adam,代码行数:41,代码来源:PlayerScript.cs

示例7: OnRightMove

        public void OnRightMove(Player.Player player)
        {
            if (_isDucking)
                return;

            float acc = WalkAcc;
            if (player.IsRunningFast)
            {
                acc = RunAcc;
                player.AddAnimationToQueue("run");
            }

            if (player.IsJumping)
            {
                acc /= 2;
            }

            if (player.GetVelocity().X < -3 && player.IsRunningFast)
            {
                player.AddAnimationToQueue("slide");
            }

            player.IsFacingRight = true;
            player.SetVelX(player.GetVelocity().X + acc);
            player.CreateMovingParticles();

            if (player.CurrentAnimationFrame == 1 || player.CurrentAnimationFrame == 3)
            {
                _stepSound.PlayNewInstanceOnce();
            }
            else
            {
                _stepSound.Reset();
            }

            player.AddAnimationToQueue("walk");
        }
开发者ID:DuckKnightDuel,项目名称:Adam,代码行数:37,代码来源:PlayerScript.cs

示例8: OnJumpAction

        public void OnJumpAction(Player.Player player)
        {
            if (!player.IsJumping)
            {
                player.Sounds.Get("jump").Play();
                player.IsJumping = true;
                player.SetVelY(JumpAcc);
                player.ChangePosBy(0, -1);
                player.AddAnimationToQueue("jump");
                player.CollidedWithTileBelow += OnTouchGround;

                for (int i = 0; i < 10; i++)
                {
                    SmokeParticle par = new SmokeParticle(CalcHelper.GetRandomX(player.GetCollRectangle()),player.GetCollRectangle().Bottom,new Vector2(GameWorld.RandGen.Next((int)player.GetVelocity().X - 1,(int)player.GetVelocity().X + 1)/10f,-GameWorld.RandGen.Next(1,10)/10f));
                    GameWorld.ParticleSystem.Add(par);
                }

            }

            if (_airTimer.TimeElapsedInMilliSeconds < 1000)
            {
                player.GravityStrength = Main.Gravity * .75f;
            }
            else
            {
                player.GravityStrength = Main.Gravity;
            }
        }
开发者ID:DuckKnightDuel,项目名称:Adam,代码行数:28,代码来源:PlayerScript.cs


注:本文中的Player.AddAnimationToQueue方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。