Example #1
0
        public void Movement_Resist()
        {
            // resist slows you down after movement has occured

            _movement.Start(_container);
            _movement.Floating = true;

            _movement.ResistX(0.8f);
            _movement.VelocityX = 10;
            _container.Tick();

            Assert.AreEqual(10, _position.Position.X);
            Assert.AreEqual(8, _movement.VelocityX);

            _movement.ResistX(0.5f);
            _container.Tick();

            Assert.AreEqual(18, _position.Position.X);
            Assert.AreEqual(4, _movement.VelocityX);
        }