Пример #1
0
        internal void MoveToRelative(Vector2 destination, int duration, EasingTypes easing = EasingTypes.None)
        {
            Transformation lastRelative = Transformations.Find(t => t.TagNumeric == 125);

            if (lastRelative != null)
            {
                Position = lastRelative.EndVector;
            }

            lock (SpriteManager.SpriteLock)
                Transformations.RemoveAll(t => (t.Type & TransformationType.Movement) > 0);

            Transformation tr = new Transformation(Position, Position + destination, GameBase.GetTime(Clock), GameBase.GetTime(Clock) + duration)
            {
                Easing     = easing,
                TagNumeric = 125
            };

            Transformations.Add(tr);
        }