Download presentation
Presentation is loading. Please wait.
Published byKellen Flash Modified over 10 years ago
1
Project Starfighter 1.2 Team 15
2
User Stories for 1.2 Part 1 As a user upon destroying an enemy my score will be updated. As a user colliding with an enemy ship I want to be destroyed as well as the enemy. As a user firing the ships laser, destroying an enemy, or dying I want to hear a sound effect. As a user playing the game, I want the screen to display current, updated statistics on my ships health, number of lives, powerups engaged, or ammo supply as needed.
3
User Stories for 1.2 Part 2 As a user who has exhausted his spaceship's health / number of lives, I want to be presented with the main menu again so that I may choose from its options. As an type 1 enemy in the game, I will move in pre- defined directions with the aim of colliding with the user player before I am out of the screen or before I am shot.
4
Enemy Test Code [TestClass] public class Enemy1_Test { Enemy1 target; GameTime gameTime; public void Enemy1ConstructorTest() { gameTime = MockRepository.GenerateStub (); Texture2D texture = null; int X = 0; int Y = 0; int W = 45; int H = 73; int Frames = 1; target = new Enemy1(texture, X, Y, W, H, Frames); }
5
[TestMethod()] public void DeactivateTest() { bool status = target.IsActive; bool active = true; target.Deactivate(); Assert.AreEqual(active, status); } [TestMethod()] public void MovementTest() { target.Movement(); Assert.Inconclusive("A method that does not return a value cannot be verified."); }
6
[TestMethod()] public void GenerateTest() { int shipNumber = 1; int expectedY = 100; bool expectedActive = true; target.Generate(shipNumber); bool actualActive = target.IsActive; int calculatedY = target.Y; int expectedX = 750; int calculatedX = target.X; Assert.AreEqual(expectedX, calculatedX); Assert.AreEqual(expectedActive, actualActive); Assert.AreEqual(expectedY, calculatedY); }
7
[TestMethod()] public void IsActiveTest() { bool expected = true; bool actual; actual = target.IsActive; Assert.AreEqual(expected, actual); } [TestMethod()] public void OffsetTest() { int expectedOffset = 50; target.Offset = 50; Assert.AreEqual(expectedOffset, target.Offset); }
8
[TestMethod()] public void XTest() { int x = 50; target.X = 50; Assert.AreEqual(x, target.X); } [TestMethod()] public void YTest() { int y = 50; target.Y = 50; Assert.AreEqual(y, target.Y); }
9
Collisions Test Code [TestMethod] public void CollisionTest() { Background background = new Background(); gameTime = MockRepository.GenerateStub (); victim = new Player(); turtle = new Enemy1(); laser = new Ammo(); //enemy default test constructor x:10 y:10 //player default x:0 y:0 //ammo default x:0 y:0 } [TestMethod] public void player_enemyTest() { victim.X = 11; victim.Y = 11; Assert.IsTrue(Intersects(victim.BoundingBox, turtle.CollisionBox)); } [TestMethod] public void laser_enemyTest() { laser.Fire(11,11); Assert.IsTrue(Intersects(laser.BoundingBox, turtle.CollisionBox)); }
10
Lives Test Code HudValues hud = new HudValues(); [TestMethod] public void LivesValue_Test() { hud.lives = 3; Assert.AreEqual(3, hud.lives); }
11
Score Test Code [TestMethod] public void ScoreValue_Test() { hud.score = 0; Assert.AreEqual(0, hud.score); }
12
Level Test Code [TestMethod] public void LevelValue_Test() { hud.level = 1; Assert.AreEqual(1, hud.level); }
13
Sound Effect Test Code [TestMethod] public void Test_Load() { string laserSound= “Laser"; Assert.IsNotNull(songlocation); string enemy1Sound= “Enemy1Explosion"; Assert.IsNotNull(songlocation); string shipSound= “ShipExplosion"; Assert.IsNotNull(songlocation); }
14
Demo
15
Status of the Game A user can now fire multiple lasers An enemy of type 1 moves in a predefined direction The player can destroy his ship and the enemy ship by colliding. A laser will destroy the enemy ship Scores and lives are updated as needed Upon death player is returned to main menu Starting a new game works but enemies spawn where the player died.
16
Plans for version 2.0 Add explosions for destruction of all ships Add a second enemy type upon the destruction of all enemies of type 1 Add a boss after enemy 2. Have score submission Have a victory screen Have a gameover popup screen that presents the option to go to the main menu or exit
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.