Exemple #1
0
 public Enemy()
     : base()
 {
     position = Vector2.Zero;
     alive = false;
     exploding = false;
     velocity = new Vector2(50.0f, 200.0f);
     theta = (float)Math.Tan((position.X - velocity.X) / (position.Y - velocity.Y));
     theta = MathHelper.WrapAngle(theta);
     explosionAnimation = new SmallExplosionAnimation();
 }
 public LargeExplosionAnimation(Texture2D textureToExplode)
 {
     this.textureToExplode = textureToExplode;
     textureToExplodeData = new Color[textureToExplode.Width * textureToExplode.Height];
     this.textureToExplode.GetData(textureToExplodeData);
     startPosition = Vector2.Zero;
     spawnExplosionCoolDown = 0;
     coolDown = 5.0f;
     active = false;
     explosions = new SmallExplosionAnimation[maxExplosions];
     for(int i = 0; i < maxExplosions; i++)
     {
         explosions[i] = new SmallExplosionAnimation();
     }
     bigExplosion = new BigExplosionAnimation();
 }
Exemple #3
0
 public Missle(bool friendly)
     : base()
 {
     if (AeroGame.lagTest)
         texture = AeroGame.LoadTextureStream("Particle16");
     else
         texture = AeroGame.ContentManager.Load<Texture2D>("Textures\\Particle16");
     textureData = new Color[texture.Width * texture.Height];
     texture.GetData(textureData);
     position = new Vector2();
     velocity = new Vector2(0, 300.0f);///////////
     health = 1;
     alive = false;
     exploding = false;
     this.friendly = friendly;
     explosionAnimation = new SmallExplosionAnimation();
     smoke = new ExplosionSmokeParticleSystem(1);
     smoke.Initialize();
     smoke.LoadContent();
     speed = 300;
 }
Exemple #4
0
        public static void LoadContent()
        {
            texture = AeroGame.ContentManager.Load<Texture2D>("Textures\\Player");
            textureInvincible = AeroGame.ContentManager.Load<Texture2D>("Textures\\PlayerGlow");
            textureData = new Color[texture.Width * texture.Height];
            texture.GetData(textureData);
            soundFireBullet = AeroGame.ContentManager.Load<SoundEffect>("Sounds\\PlayerLaser");
            soundFireBomb = AeroGame.ContentManager.Load<SoundEffect>("Sounds\\Bomb");
            soundHit = AeroGame.ContentManager.Load<SoundEffect>("Sounds\\PlayerHit");
            soundKill = AeroGame.ContentManager.Load<SoundEffect>("Sounds\\PlayerKill");
            position = startingPosition = new Vector2(AeroGame.Graphics.GraphicsDevice.Viewport.Width / 2 - texture.Width / 2.0f,
                                    AeroGame.Graphics.GraphicsDevice.Viewport.Height * .75f);
            center = new Vector2(position.X + texture.Width / 2.0f, position.Y + texture.Height / 2.0f);
            origin = new Vector2(texture.Width / 2, texture.Height / 2);
            speed = 200.0f;
            velocity = new Vector2(speed);
            alive = true;
            reviving = false;
            exploding = false;
            invincible = false;
            powerUpActive = false;
            resetInvincibilityCooldown = 1.0f;
            powerUpCooldown = 0;
            rapidFireCooldown = 0;
            invincibilityCooldown = 0;
            lives = 3;
            mainWeaponPower = 10;
            currentShield = 30;
            maxShield = 30;
            percentShield = (int)((currentShield / maxShield) * 100);
            powerUpType = PowerUpType.None;
            standardCannon = new StandardCannon(true);
            triCannon = new TriCannon(true);
            quintuCannon = new QuintuCannon(true);
            primaryWeapon = standardCannon;
            primaryWeapon.SetCoolDown(0.2f);
            fragCannon = new FragmentationBombCannon(true);
            beamCannon = new BeamCannon(true);
            missileCannon = new MissleCannon(true);
            secondaryWeapon = fragCannon;
            explodingAnimation = new SmallExplosionAnimation();
            reviveAnimation = new ReviveAnimation();
            dt = TimeSpan.Zero;
            theta = 0;
            spriteBatch = new SpriteBatch(AeroGame.Graphics.GraphicsDevice);
            rotation = new Matrix();
            boundingRectangle = new Rectangle();
            scale = 1;
            //Bounding Rectangle Data
            leftTop = Vector2.Zero;
            rightTop = Vector2.Zero;
            leftBottom = Vector2.Zero;
            rightBottom = Vector2.Zero;
            min = Vector2.Zero;
            max = Vector2.Zero;
            stringMainWeaponPower = mainWeaponPower.ToString();
            stringShield = percentShield.ToString() + "%";
            stringLives = "x" + lives.ToString();
            //saveData = new SaveGameData();
            //SignedInGamer gamer;

            //saveData.playerName = Gamer.SignedInGamers[0].Gamertag;
        }