예제 #1
0
        public void Draw(Guy guy, SpriteBatch spriteBatch, GameTime gameTime, SpriteEffects spriteEffects)
        {
            var maybeXDirection = guy.Physics.HorizontalMovementDirection;

            if (!maybeXDirection.HasValue || maybeXDirection == guy.Facing)
            {
                _runningAnimation.Draw(spriteBatch, guy.Physics.Position, gameTime, spriteEffects);
            }
            else if (maybeXDirection.Value != guy.Facing)
            {
                _slidingSprite.Draw(spriteBatch, guy.Physics.Position, spriteEffects);
            }
        }
 public void Draw(Guy guy, SpriteBatch spriteBatch, GameTime gameTime, SpriteEffects spriteEffects)
 {
     _animation.Draw(spriteBatch, guy.Physics.Position, gameTime, spriteEffects);
 }