Exemplo n.º 1
0
 public void testShouldMoveAccordingToYVelocity()
 {
     Bullet bullet = new Bullet(new MockViewFactory(100, 100, 10, 10));
     bullet.Position = new Vector2(50, 50);
     bullet.YVelocity = -10;
     bullet.Update(gameTimeWithOneSecond());
     Assert.AreEqual(new Vector2(50, 40), bullet.Position);
 }
Exemplo n.º 2
0
 public void testShouldKillItselfWhenReachingTheEdgeOfTheView()
 {
     Bullet bullet = new Bullet(new MockViewFactory(100, 100, 10, 10));
     bullet.Position = new Vector2(50, 10);
     bullet.YVelocity = -10;
     bullet.Alive = true;
     bullet.Update(gameTimeWithOneSecond());
     Assert.AreEqual(false, bullet.Alive);
 }