Esempio n. 1
0
 /// <summary>
 ///A test for Enemy1 Constructor
 ///</summary>
 public void Enemy1ConstructorTest()
 {
     gameTime = MockRepository.GenerateStub<GameTime>();
     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);
     //Assert.Inconclusive("TODO: Implement code to verify target");
 }
Esempio n. 2
0
        // Constructor
        public ActionScreen(Game game, SpriteBatch spriteBatch, Texture2D background, ContentManager content)
            : base(game, spriteBatch)
        {
            gameBackgroundImage = background; // give an image to the background
            backgroundFileWidth = gameBackgroundImage.Width; // give the width to the background
            backgroundFileHeight = gameBackgroundImage.Height; // give the height to the background

            player = new Player(content.Load<Texture2D>(@"Textures\PlayerShip")); // initialize player

            // fill EnemiesType1 array with enemies of type 1
            for (int i = 0; i < iTotalMaxEnemies; i++)
            {
                EnemiesType1[i] = new Enemy1(content.Load<Texture2D>(@"Textures\TurtleRobot"), 0, 0, 73, 45, 1);
            }

            // fill EnemiesType2 array with enemies of type 2
            for (int i = 0; i < iTotalMaxEnemies2; i++)
            {
                EnemiesType2[i] = new Enemy2(content.Load<Texture2D>(@"Textures\spacerabbit"), 0, 0, 46, 75, 1);
                EnemiesType2[i].InitializeBullets(content.Load<Texture2D>(@"Textures\PlayerAmmo"));
            }

            boss = new Boss(content.Load<Texture2D>(@"Textures\donald2"), 0, 0, 150, 104, 1); // Create boss
            boss.InitializeBullets(content.Load<Texture2D>(@"Textures\PlayerAmmo")); // 4/27 innitialize sprites for the boss's bullets

            gameHudImage = content.Load<Texture2D>(@"Textures\hud"); // load "HUD"
            spriteFont = content.Load<SpriteFont>(@"Fonts\Pericles"); // load font

            //initialize ammo
            bolts[0] = new Ammo(content.Load<Texture2D>(@"Textures\PlayerAmmo"));

            for (int x = 1; x < iMaxBolts; x++)
                bolts[x] = new Ammo(content.Load<Texture2D>(@"Textures\PlayerAmmo"));

            // load content for sound effects
            laserFire = content.Load<SoundEffect>(@"Audio\Laser");
            laserFire2 = content.Load<SoundEffect>(@"Audio\Laser2");
            enemy1Destroyed = content.Load<SoundEffect>(@"Audio\Enemy1Explosion");
            playerDestroyed = content.Load<SoundEffect>(@"Audio\ShipExplosion");
            sorry = content.Load<SoundEffect>(@"Audio\sorryLouder");
            maroon = content.Load<SoundEffect>(@"Audio\maroonLouder");
            ultraMaroon = content.Load<SoundEffect>(@"Audio\ultraMaroonLouder");

            youFired = content.Load<SoundEffect>(@"Audio\YouFiredLoud");
            youFiredSoundInstance = youFired.CreateInstance();
            youFiredSoundInstance.Volume = 1;
            youFiredSoundInstance.Pitch = 0.1f;

            alien = content.Load<SoundEffect>(@"Audio\Alien");
            alienSoundInstance = alien.CreateInstance();
            alienSoundInstance.Volume = 1;

            deal = content.Load<SoundEffect>(@"Audio\deal");
            dealSoundInstance = deal.CreateInstance();
            dealSoundInstance.Volume = 1;

            youFiredSoundDuration = alien.Duration;

            maroonSoundInstance = maroon.CreateInstance(); // Create maroon sound instance
            ultraMaroonSoundInstance = ultraMaroon.CreateInstance(); // create ultra maroon sound instance
            sorrySoundInstance = sorry.CreateInstance(); // create sorry sound instance

            maroonSoundDuration = maroon.Duration; // get duration of maroon effect

            maroonSoundInstance.Volume = 1; // set volume 0 - 1
            ultraMaroonSoundInstance.Volume = 1; // set volume 0 - 1
        }
Esempio n. 3
0
 public void UpdateTest()
 {
     Texture2D texture = null; // TODO: Initialize to an appropriate value
     int X = 0; // TODO: Initialize to an appropriate value
     int Y = 0; // TODO: Initialize to an appropriate value
     int W = 0; // TODO: Initialize to an appropriate value
     int H = 0; // TODO: Initialize to an appropriate value
     int Frames = 0; // TODO: Initialize to an appropriate value
     Enemy1 target = new Enemy1(texture, X, Y, W, H, Frames); // TODO: Initialize to an appropriate value
     //GameTime gametime = null; // TODO: Initialize to an appropriate value
     int iOffset = 0; // TODO: Initialize to an appropriate value
        // target.Update(gametime, iOffset);
       //  Assert.Inconclusive("A method that does not return a value cannot be verified.");
 }