110 likes | 219 Views
Project Starfighter 2.0. Team 15. User Stories for 2.0 Part 1. As a user who destroys all enemy of type 1 I want the enemy type 2 to be displayed.
E N D
Project Starfighter 2.0 Team 15
User Stories for 2.0 Part 1 • As a user who destroys all enemy of type 1 I want the enemy type 2 to be displayed. • As an type 2 enemy in the game, I will move in a vertical direction and randomly shoot with the aim of hitting the user player before I am shot. • As an type 2 enemy in the game who hits the player one time I will say one quote, if I hit a second time I will say a different quote.
User Stories for 2.0 Part 2 • As a boss in the game, I will move in a vertical direction and randomly shoot with the aim of hitting the user player before I am shot. • As a boss in the game who hits the player I will say a quote, if I am hit I will say another quote. • As a player in the game who beats the boss I will be presented the winning screen. • As a player in the game who loses I will be presented the game over screen.
Enemy 2 / Boss Test Code // test if enemy can be deactivated [TestMethod] public void Deactivate_Test() { target.Deactivate(); Assert.IsFalse(target.IsActive); } // test if enemy is initially set to inactive [TestMethod] public void IsActive_Test() { Assert.AreEqual(false, target.IsActive); }
// test if boss's x position can be changed [TestMethod] public void X_Test() { intxtest = 45; target.X = xtest; Assert.AreEqual(xtest, target.X); } // test if boss's y position can be changed [TestMethod] public void Y_Test() { intytest = 45; target.Y = ytest; Assert.AreEqual(ytest, target.Y); }
// test if the enemy will be activated in the correct position [TestMethod] public void Generate_Test() { target.Generate(1); Assert.AreEqual(750, target.X); Assert.AreEqual(150, target.Y); Assert.IsTrue(target.IsActive); } // check if the method that changes the enemy's direction in case it is out of the limits is working [TestMethod] public void GetDrawY_Test() { target.Generate(1); target.Y = 201; target.GetDrawY(); Assert.IsTrue(target.getChangeDirection); target.Y = 99; target.GetDrawY(); Assert.IsFalse(target.getChangeDirection); }
// test if the bounding box is the desired size of the enemy's current image [TestMethod] public void BoundingBox_Test() { Rectangle square = new Rectangle(752, 77, 42, 71); target.Generate(0); Assert.AreEqual(square, target.CollisionBox); }
Winning screen Test Code [TestClass] public class VictoryScreen_Test { [TestMethod] public void UpdateScore_Test() { string score; int place = 100; score = "Your final score was: "; score += place.ToString(); string expected = "Your final score was: 100"; Assert.AreEqual(expected, score); } }
Game Over screen Test Code [TestClass] public class GameOverScreen_Test { [TestMethod] public void UpdateScore_Test() { string score; int place = 100; score = "Your final score was: "; score += place.ToString(); string expected = "Your final score was: 100"; Assert.AreEqual(expected, score); } }
Status of the Game • Second type enemies are added upon the destruction of all enemies of type 1 • A boss is added after enemies type 2 are destroyed. • A winner screen is displayed if player destroys the boss. • A game over screen is displayed if player is destroyed.