public void ApplyUpdateWithVelocity() { var entity2D = new Entity2D(new Rectangle(0, 0, 1, 1)); entity2D.Add(velocity); entity2D.Start<Velocity2D.PositionUpdate>(); var originalPosition = entity2D.Center; entity2D.Get<Velocity2D.Data>().Accelerate(2.0f, 90.0f); AdvanceTimeAndUpdateEntities(); Assert.AreNotEqual(originalPosition, entity2D.Center); }
public void ApplyUpdateWithVelocity() { var entity2D = new Entity2D(new Rectangle(0, 0, 1, 1)); entity2D.Add(velocity); entity2D.Start <Velocity2D.PositionUpdate>(); var originalPosition = entity2D.Center; entity2D.Get <Velocity2D.Data>().Accelerate(2.0f, 90.0f); AdvanceTimeAndUpdateEntities(); Assert.AreNotEqual(originalPosition, entity2D.Center); }
public static void AffixToPhysics(this Entity2D entity, PhysicsBody body) { entity.Add(body); entity.Start <AffixToPhysics2D>(); }