Example #1
0
        public override void PostUpdate(IFlyUpdateContext updateContext)
        {
            var physicsTransform = this.PhysicsTransform;

            this.Transform.Position = physicsTransform.Position.ToAtom();
            this.Transform.Rotation = physicsTransform.Angle;
        }
Example #2
0
        public override void Update(IFlyUpdateContext updateContext)
        {
            this.seconds -= updateContext.FrameTime;

            if (this.seconds <= 0.0f)
            {
                this.ApplyChain();
            }
        }
Example #3
0
 public override void PostUpdate(IFlyUpdateContext updateContext)
 {
     if (this.body.FixtureList != null)
     {
         var physicsTransform = this.PhysicsTransform;
         this.Transform.Position = physicsTransform.Position.ToAtom();
         this.Transform.Rotation = physicsTransform.Angle;
     }
 }
Example #4
0
        public void Update(IFlyUpdateContext updateContext)
        {
            this.timeLeft -= updateContext.FrameTime;

            if (this.timeLeft <= 0.0f)
            {
                this.Trigger();
            }
        }
Example #5
0
        public void PostUpdate(IFlyUpdateContext updateContext)
        {
            foreach (var component in this.Components)
            {
                var postUpdateable = component as IFlyComponent;

                if (postUpdateable != null)
                {
                    postUpdateable.PostUpdate(updateContext);
                }
            }
        }
Example #6
0
        public override void Update(IFlyUpdateContext updateContext)
        {
            if (this.Target == null)
            {
                return;
            }

            Vector2 delta     = this.Target.Position - this.Entity.Position;
            Vector2 direction = delta.Direction;
            Vector2 force     = direction * 0.5f;

            this.Entity.Physics.ApplyForce(force);
        }
Example #7
0
        public void Update(IFlyUpdateContext updateContext)
        {
            for (int i = 0; i < this.entities.Count; ++i)
            {
                entities[i].PreUpdate(updateContext);
            }

            for (int i = 0; i < entities.Count; ++i)
            {
                entities[i].Update(updateContext);
            }

            float stepTime = Math.Min((float)updateContext.GameTime.ElapsedGameTime.TotalMilliseconds * 0.001f, (1f / 30f));

            this.physicsWorld.Step(stepTime);

            for (int i = 0; i < this.entities.Count; ++i)
            {
                entities[i].PostUpdate(updateContext);
            }
        }
Example #8
0
File: Camera.cs Project: tivtag/Fly
        private void UpdateZoom(IFlyUpdateContext updateContext)
        {
            if (!isZooming)
            {
                return;
            }

            timeLeftToZoomTarget -= updateContext.FrameTime;

            if (timeLeftToZoomTarget <= 0.0f)
            {
                this.Zoom            = zoomTarget;
                timeLeftToZoomTarget = 0.0f;
                zoomTarget           = 0.0f;
                isZooming            = false;
            }
            else
            {
                float factor = 1.0f - (timeLeftToZoomTarget / ZoomTime);
                this.Zoom = Atom.Math.MathUtilities.Lerp(initialZoom, zoomTarget, factor);
            }
        }
Example #9
0
 public virtual void Update(IFlyUpdateContext updateContext)
 {
     this.colorTints.Update(updateContext);
 }
Example #10
0
 public abstract void Update(IFlyUpdateContext updateContext);
Example #11
0
 protected virtual void OnUpdate(IFlyUpdateContext drawContext)
 {
 }
Example #12
0
File: Camera.cs Project: tivtag/Fly
 public void Update(IFlyUpdateContext updateContext)
 {
     UpdateZoom(updateContext);
 }
Example #13
0
 public void Update(IFlyUpdateContext updateContext)
 {
     this.gravity.Apply();
     this.scene.Update(updateContext);
 }
Example #14
0
 public override void Update(IFlyUpdateContext updateContext)
 {
     this.action(this);
 }
Example #15
0
 public virtual void PostUpdate(IFlyUpdateContext updateContext)
 {
 }
Example #16
0
 public override void Update(IFlyUpdateContext updateContext)
 {
 }