Beispiel #1
0
        public void Update(GameTime gameTime)
        {
            _animator.Update(gameTime);

            if (IsWalking)
            {
                Position += new Vector2(50f * _direction, 0) * (float)gameTime.ElapsedGameTime.TotalSeconds;
            }
        }
Beispiel #2
0
        public void Update(GameTime gameTime)
        {
            var deltaSeconds = (float)gameTime.ElapsedGameTime.TotalSeconds;

            _animator.Update(gameTime);

            IsOnGround = false;
            //Position += Velocity * deltaSeconds;
            //Velocity *= 0.9f;

            if (State == ZombieState.Walking && Math.Abs(Velocity.X) < 0.1f)
            {
                State = ZombieState.Idle;
            }
        }