public virtual void Update(int millisecondsSinceLastUpdate)
 {
     if (MotionEngine != null)
     {
         MotionEngine.Update(millisecondsSinceLastUpdate);
         WorldPosition += MotionEngine.Delta;
     }
 }
Esempio n. 2
0
        public override void Update(GameTime gameTime)
        {
            base.Update(gameTime);
            MotionEngine.Update(gameTime);
            Collider.Update(gameTime);

            ClosestInteractable = world.GetNearestInteractable(this, new Padding(10, 5));
        }
Esempio n. 3
0
        protected override void DoInteract(GameObject with, GameTime gameTime)
        {
            Vector2 v = with.Velocity;

            v.Normalize();

            engine.GoalVelocity = with.Velocity;
            //toMove.Position += v * 0.1f;
            engine.Update(gameTime);
            //IsInteracting = false;
        }
Esempio n. 4
0
        public override void Update(GameTime gameTime)
        {
            base.Update(gameTime);

            MotionEngine.Update(gameTime);
            Collider.Update(gameTime);

            if (BehaviourObserver.HasScript)
            {
                BehaviourObserver.Script.Update(gameTime);
            }
        }
Esempio n. 5
0
        public virtual void Update(int millisecondsSinceLastUpdate)
        {
            if (MotionEngine != null)
            {
                MotionEngine.Update(millisecondsSinceLastUpdate);
            }
            if (MotionEngine != null)
            {
                WorldPosition += MotionEngine.Delta;
            }

            if (Active)
            {
                CheckForAndHandleInput(millisecondsSinceLastUpdate);
            }
        }
Esempio n. 6
0
        public virtual void Update(int millisecondsSinceLastUpdate)
        {
            if ((!Paused) && (MotionEngine != null))
            {
                MotionEngine.Update(millisecondsSinceLastUpdate);

                WorldPosition += MotionEngine.Delta;

                if (_lifeCycleState == LifeCycleStateValue.Exiting)
                {
                    Tint  = Color.Lerp(Color.White, Color.Transparent, _motionEngine.Progress);
                    Scale = 1.0f + (_motionEngine.Progress / 2.0f);
                    if (_motionEngine.Progress == 1.0f)
                    {
                        UpdateLifeCycleState(LifeCycleStateValue.ReadyForRemoval);
                    }
                }
            }
        }
Esempio n. 7
0
        public void Update(int millisecondsSinceLastUpdate)
        {
            if (ReturningToPreviousLocation)
            {
                _motionEngine.Target = _startPosition;

                MotionEngine.Update(millisecondsSinceLastUpdate);

                if ((WorldPosition == _startPosition) || (Vector2.DistanceSquared(WorldPosition, _startPosition) < MotionEngine.Delta.LengthSquared()))
                {
                    WorldPosition = _startPosition;
                    ReturningToPreviousLocation = false;
                }
                else
                {
                    WorldPosition += MotionEngine.Delta;
                }
            }
        }
 void Update()
 {
     // 更新框架
     MotionEngine.Update();
 }