public void CreateFallingEffectFromDrawArea() { var resolver = new TestResolver(); var content = resolver.Resolve<Content>(); var effect = new FallingEffect(content.Load<Image>("test"), Rectangle.One); Assert.AreEqual(Rectangle.One, effect.DrawArea); }
public void RotationSpeed() { var resolver = new TestResolver(); var content = resolver.Resolve<Content>(); var effect = new FallingEffect(content.Load<Image>("test"), Rectangle.One) { RotationSpeed = 1.0f }; Assert.AreEqual(1.0f, effect.RotationSpeed); }
public void Gravity() { var resolver = new TestResolver(); var content = resolver.Resolve<Content>(); var effect = new FallingEffect(content.Load<Image>("test"), Rectangle.One) { Gravity = Point.Half }; Assert.AreEqual(Point.Half, effect.Gravity); }
public void FallingEffectIsRemovedAfterOneSecond() { Start(typeof(TestResolver), (Content content, Renderer renderer) => { var effect = new FallingEffect(content.Load<Image>("test"), Rectangle.One) { Velocity = Point.Half, Gravity = new Point(1.0f, 2.0f), RotationSpeed = 100.0f }; renderer.Add(effect); CheckFallingEffectStateAfterHalfASecond(effect, renderer); CheckFallingEffectStateAfterOneSecond(effect, renderer); }); }