160 likes | 258 Views
Project Starfighter 1.1. Team 15. User Stories for 1.1 Part 1. As a user upon starting the application I want to hear music. Upon starting the game new music is played As a user who clicks on the menu option, 'instructions,' I want to be presented with the instructions to play the game.
E N D
Project Starfighter 1.1 Team 15
User Stories for 1.1 Part 1 • As a user upon starting the application I want to hear music. Upon starting the game new music is played • As a user who clicks on the menu option, 'instructions,' I want to be presented with the instructions to play the game. • As a user controlling the ship I want to be able to move up, down, left and right. • As a user controlling the ship I want to be able to shoot a laser
Music Test Code • boolstartMenuSong = true; • boolstartLevelOneSong = false; • public Starfighter_Test() • { • Test_Load(); • HandleStartScreen_Test(); • HandleActionScreen_Test(); • }
[TestMethod] • public void Test_Load() • { • string songlocation = "Menu"; • Assert.IsNotNull(songlocation); • boolrepeatSong = true; • Assert.IsTrue(repeatSong); • } • [TestMethod] • public void HandleStartScreen_Test() • { • Assert.istrue(startMenuSong); • startMenuSong = false; • Assert.IsFalse(startMenuSong); • }
[TestMethod] • public void HandleActionScreen_Test() • { • Assert.IsFalse(startLevelOneSong); • startLevelOneSong = true; • Assert.IsTrue(startMenuSong); • startLevelOneSong = false; • Assert.IsFalse(startLevelOneSong); • }
Ship Movement Test Code • [TestClass] • public class ShipMovements • { • ActionScreenbckgnd = new ActionScreen(); • Player p = new Player(); • [TestMethod] • public void ShipMovingRight_Test() //left is just like this one • { • bckgnd.BackgroundOffset = 0; • bckgnd.BackgroundOffset += 1; • Assert.AreEqual(1, bckgnd.BackgroundOffset); • }
Ship Movement Test Code (cont) • [TestMethod] • public void ShipMovingUp_Test() // moving down test is just like it • { • p.Y = 0; • p.Y += 1; • Assert.AreEqual(1, p.Y); • }
Instructions Test Code • [TestClass] • public class InstructionsScreen_Test • { • [TestInitialize()] • public void TestInitialize() • { • Starfighter game = new Starfighter(); • } • InstructionsScreentestInstructionsScreen; • private TestContexttestContextInstance; • [TestMethod] • public void TestScreen() • { • Assert.IsNotNull(testInstructionsScreen); • }
Instructions Test Code (cont) • [TestMethod] • public void TestType() • { • Assert.IsInstanceOfType(testInstructionsScreen, typeof(InstructionsScreen)); • } • } • public TestContextTestContext { • get • { return testContextInstance; } • set • { testContextInstance = value; }
Laser Test Code [TestMethod] public void XPosition_Test() { testammo.aLocation.X = 11f; Assert.IsTrue(11f == testammo.aLocation.X); } [TestMethod] public void YPosition_Test() { testammo.aLocation.Y = 12f; Assert.IsTrue(12f == testammo.aLocation.Y); }
[TestMethod] public void createdInActive_Test() { Assert.IsTrue(false == testammo.IsActive); } [TestMethod] public void fired_Test() { testammo.Fire(21, 33); Assert.IsTrue(true == testammo.IsActive); }
[TestMethod] public void firedXPosition_Test() { testammo.Fire(21, 33); Assert.AreEqual(21f, testammo.aLocation.X); } [TestMethod] public void firedYPosition_Test() { testammo.Fire(21, 33); Assert.AreEqual(33f, testammo.aLocation.Y); }
//[TestMethod] //public void Speed_Test() //{ // testammo.Speed = 10f; // Assert.IsTrue(10f == testammo.Speed); //} [TestMethod] public void BoundingBox_Test() { testammo.Fire(21, 33); Rectangle r = new Rectangle(21, 33, 16, 3); Assert.AreEqual(r, testammo.BoundingBox); }
Status of the Game • At this point all of the menu options except for high score are complete. • The ship can move. The background is also set to auto scroll. • The ship can now shoot a laser, but only one at a time.
Plans for version 1.2 • Adjust speed of the ship to move faster • Allow multiple lasers to be fired. • Add sound effects • Create an enemy type 1 (doesn’t fire anything) • Create collision box for collisions • Set up player lives • Create collision detection for laser hitting enemy • Calculate score based on destruction of enemy