我想把球员放下来 [英] I woud like to make the player duck down

查看:80
本文介绍了我想把球员放下来的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好!


我开始玩2D XNA游戏,我想让玩家瘫痪。我已经有动画,但我需要让他下来。动画的代码如下...感谢您的关注!

 protected override void UpdateAnimations()
{
if(currentAnimation == null)
return;

base.UpdateAnimations();

if(velocidade!= Vector2.Zero || jumping == true)

{
if(direcao.X< 0&& AnimationIsNot( Animations.RunRight))
ChangeAnimation(Animations.RunRight);

else if(direcao.X> 0&& AnimationIsNot(Animations.RunLeft))
ChangeAnimation(Animations.RunLeft);
}
else if(velocidade == Vector2.Zero || jumping == false)
{
if(direcao.X< 0&& AnimationIsNot(Animations。 IdleRight))
ChangeAnimation(Animations.IdleRight);

else if(direcao.X> 0&& AnimationIsNot(Animations.IdleLeft))
ChangeAnimation(Animations.IdleLeft);
}

解决方案

Hi Lomba_77,


欢迎来到MSDN论坛。


根据您的代码和描述,似乎与c#相关,以满足您的需求。由于我们的论坛主要关注VS
IDE问题,我建议您重定向到
VS语言论坛
并开始一个新线程以获得更好的支持。


感谢您的理解。


最好的问候


May  &NBSP;&NBSP;


Hello everyone!

I began a game 2d XNA and I woud like to make the player duck down. I have already the animation but I need to make him get down. The animation's code are bellow... Thank you for your attention!

protected override void UpdateAnimations()
        {
            if (currentAnimation == null)
                return;

            base.UpdateAnimations();

            if (velocidade != Vector2.Zero || jumping == true)
        
            {
                if (direcao.X < 0 && AnimationIsNot(Animations.RunRight))
                    ChangeAnimation(Animations.RunRight);

                else if (direcao.X > 0 && AnimationIsNot(Animations.RunLeft))
                    ChangeAnimation(Animations.RunLeft);
            }
            else if (velocidade == Vector2.Zero || jumping == false)
            {
                if (direcao.X < 0 && AnimationIsNot(Animations.IdleRight))
                    ChangeAnimation(Animations.IdleRight);

                else if (direcao.X > 0 && AnimationIsNot(Animations.IdleLeft))
                    ChangeAnimation(Animations.IdleLeft);
            } 

解决方案

Hi Lomba_77,

Welcome to the MSDN forum.

Based on your code and description, it seems be related with c # to impelement this your requrienment. Since our forum mainly focus on VS IDE issue, i recommend you redirect to the VS language forum and start a new thread for a better supporting.

Thank you for your understanding.

Best Regards

May    


这篇关于我想把球员放下来的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆