コード例 #1
0
 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);
 }
コード例 #2
0
 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);
 }
コード例 #3
0
 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);
 }
コード例 #4
0
 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);
     });
 }