public ArtilleryBoss() : base() { if (AeroGame.lagTest) texture = AeroGame.LoadTextureStream("ArtilleryBoss"); else texture = AeroGame.ContentManager.Load<Texture2D>("Textures\\ArtilleryBoss"); textureData = new Color[texture.Width * texture.Height]; texture.GetData(textureData); soundFireBullet = AeroGame.ContentManager.Load<SoundEffect>("Sounds\\EnemyLaser"); soundFireBomb = AeroGame.ContentManager.Load<SoundEffect>("Sounds\\Bomb"); /*pieces = new ObjectPiece[8]; pieces[0] = new ObjectPiece(AeroGame.ContentManager.Load<Texture2D>("Textures\\Boss3Piece1"), new Vector2((float)Math.Cos(Math.PI), (float)Math.Sin(Math.PI))); pieces[1] = new ObjectPiece(AeroGame.ContentManager.Load<Texture2D>("Textures\\Boss3Piece2"), new Vector2((float)Math.Cos(-2 * Math.PI / 3), (float)Math.Sin(-2 * Math.PI / 3)));// pieces[2] = new ObjectPiece(AeroGame.ContentManager.Load<Texture2D>("Textures\\Boss3Piece3"), new Vector2((float)Math.Cos(-Math.PI / 3), (float)Math.Sin(-Math.PI / 3))); pieces[3] = new ObjectPiece(AeroGame.ContentManager.Load<Texture2D>("Textures\\Boss3Piece4"), new Vector2((float)Math.Cos(0), (float)Math.Sin(0))); pieces[4] = new ObjectPiece(AeroGame.ContentManager.Load<Texture2D>("Textures\\Boss3Piece5"), new Vector2((float)Math.Cos(-5 * Math.PI / 6), (float)Math.Sin(-5 * Math.PI / 6)));// pieces[5] = new ObjectPiece(AeroGame.ContentManager.Load<Texture2D>("Textures\\Boss3Piece6"), new Vector2((float)Math.Cos(3 * Math.PI / 4), (float)Math.Sin(3 * Math.PI / 4))); pieces[6] = new ObjectPiece(AeroGame.ContentManager.Load<Texture2D>("Textures\\Boss3Piece7"), new Vector2((float)Math.Cos(Math.PI / 4), (float)Math.Sin(Math.PI / 4))); pieces[7] = new ObjectPiece(AeroGame.ContentManager.Load<Texture2D>("Textures\\Boss3Piece8"), new Vector2((float)Math.Cos(-Math.PI / 6), (float)Math.Sin(-Math.PI / 6))); */ //origin = new Vector2(texture.Width / 2, texture.Height / 2); position = new Vector2(0, texture.Height * -1.0f); center = new Vector2(position.X + texture.Width / 2.0f, position.Y); mainWeapon = new PrimaryWeapon[1]; mainWeapon[0] = new TriCannon(false); mainWeapon[0].SetCoolDown(1.0f); secondaryWeapon = new SecondaryWeapon[1]; secondaryWeapon[0] = new FragmentationBombCannon(false, 1.0f); secondaryWeapon[0].CoolDownLimit = 5.0f; explodingAnimation = new LargeExplosionAnimation(texture); health = 2000; firingAngle = 0; speed = 300; }
public Fighter() : base() { if (AeroGame.lagTest) texture = AeroGame.LoadTextureStream("Fighter"); else texture = AeroGame.ContentManager.Load<Texture2D>("Textures\\Fighter"); textureData = new Color[texture.Width * texture.Height]; texture.GetData(textureData); soundFireBullet = AeroGame.ContentManager.Load<SoundEffect>("Sounds\\EnemyLaser"); origin = new Vector2(texture.Width / 2, texture.Height / 2); health = maxHealth = 30; mainWeapon = new StandardCannon(false); mainWeapon.SetCoolDown(1.0f); firingAngle = -MathHelper.Pi / 2; }
public TwinTwo() : base() { if (AeroGame.lagTest) texture = AeroGame.LoadTextureStream("TwinBossRight"); else texture = AeroGame.ContentManager.Load<Texture2D>("Textures\\TwinBossRight"); textureData = new Color[texture.Width * texture.Height]; texture.GetData(textureData); soundFireBullet = AeroGame.ContentManager.Load<SoundEffect>("Sounds\\EnemyLaser"); //origin = new Vector2(texture.Width / 2, texture.Height / 2); position = new Vector2(0, texture.Height * -1.0f); center = new Vector2(position.X + texture.Width / 2.0f, position.Y); mainWeapon = new PrimaryWeapon[1]; mainWeapon[0] = new TriCannon(false); mainWeapon[0].SetCoolDown(1.0f); explodingAnimation = new LargeExplosionAnimation(texture); health = 1000; firingAngle = 0; seperated = false; }
public TwinBoss() : base() { if (AeroGame.lagTest) texture = AeroGame.LoadTextureStream("TwinBossCenter"); else texture = AeroGame.ContentManager.Load<Texture2D>("Textures\\TwinBossCenter"); textureData = new Color[texture.Width * texture.Height]; texture.GetData(textureData); soundFireBullet = AeroGame.ContentManager.Load<SoundEffect>("Sounds\\EnemyLaser"); soundFireBomb = AeroGame.ContentManager.Load<SoundEffect>("Sounds\\Bomb"); /*pieces = new ObjectPiece[8]; pieces[0] = new ObjectPiece(AeroGame.ContentManager.Load<Texture2D>("Textures\\Particle16"), new Vector2((float)Math.Cos(Math.PI), (float)Math.Sin(Math.PI))); pieces[1] = new ObjectPiece(AeroGame.ContentManager.Load<Texture2D>("Textures\\Particle16"), new Vector2((float)Math.Cos(-2 * Math.PI / 3), (float)Math.Sin(-2 * Math.PI / 3)));// pieces[2] = new ObjectPiece(AeroGame.ContentManager.Load<Texture2D>("Textures\\Particle16"), new Vector2((float)Math.Cos(-Math.PI / 3), (float)Math.Sin(-Math.PI / 3))); pieces[3] = new ObjectPiece(AeroGame.ContentManager.Load<Texture2D>("Textures\\Particle16"), new Vector2((float)Math.Cos(0), (float)Math.Sin(0))); pieces[4] = new ObjectPiece(AeroGame.ContentManager.Load<Texture2D>("Textures\\Particle16"), new Vector2((float)Math.Cos(-5 * Math.PI / 6), (float)Math.Sin(-5 * Math.PI / 6)));// pieces[5] = new ObjectPiece(AeroGame.ContentManager.Load<Texture2D>("Textures\\Particle16"), new Vector2((float)Math.Cos(3 * Math.PI / 4), (float)Math.Sin(3 * Math.PI / 4))); pieces[6] = new ObjectPiece(AeroGame.ContentManager.Load<Texture2D>("Textures\\Particle16"), new Vector2((float)Math.Cos(Math.PI / 4), (float)Math.Sin(Math.PI / 4))); pieces[7] = new ObjectPiece(AeroGame.ContentManager.Load<Texture2D>("Textures\\Particle16"), new Vector2((float)Math.Cos(-Math.PI / 6), (float)Math.Sin(-Math.PI / 6))); */ //origin = new Vector2(texture.Width / 2, texture.Height / 2); //soundFireBullet = AeroGame.ContentManager.Load<SoundEffect>("Sounds\\EnemyLaser"); position = new Vector2(0, texture.Height * -1.0f); center = new Vector2(position.X + texture.Width / 2.0f, position.Y); mainWeapon = new PrimaryWeapon[1]; mainWeapon[0] = new QuintuCannon(false); mainWeapon[0].SetCoolDown(1.0f); secondaryWeapon = new SecondaryWeapon[1]; secondaryWeapon[0] = new FragmentationBombCannon(false, 1.0f); secondaryWeapon[0].CoolDownLimit = 5.0f; explodingAnimation = new LargeExplosionAnimation(texture); health = 1000; //firingAngle = 0; seperated = false; twinOne = new TwinOne(); twinTwo = new TwinTwo(); shield = new Shield(); speed = 150.0f; }
private static void ReviveReset() { resetInvincibilityCooldown = 1.0f; invincible = true; revivalExpansionValue = 1; CurrentShield = maxShield; position = startingPosition; primaryWeapon.Center = center; alive = true; //Reset PowerUp powerUpCooldown = 0; powerUpType = PowerUpType.None; primaryWeapon = standardCannon; primaryWeapon.SetCoolDown(0.2f); powerUpActive = false; }
public static void Update(TimeSpan elapsedTime) { dt = elapsedTime; Position = new Vector2(position.X, position.Y); primaryWeapon.Update(elapsedTime); secondaryWeapon.Update(elapsedTime); if (invincible && !powerUpActive) { resetInvincibilityCooldown -= (float)elapsedTime.TotalSeconds; if (resetInvincibilityCooldown < 0) { invincible = false; resetInvincibilityCooldown = 1.0f; } } primaryWeapon.Center = center; secondaryWeapon.Center = center; if (exploding) { if (explodingAnimation.Active) explodingAnimation.Update(elapsedTime); else { exploding = false; } } if (reviving) { if (reviveAnimation.Active) reviveAnimation.Update(elapsedTime); else { reviving = false; ReviveReset(); } } if (powerUpCooldown > 0) { powerUpCooldown -= (float) elapsedTime.TotalSeconds; if (powerUpCooldown <= 0) { powerUpCooldown = 0; powerUpType = PowerUpType.None; primaryWeapon = standardCannon; primaryWeapon.SetCoolDown(0.2f); powerUpActive = false; } } if (rapidFireCooldown > 0) { rapidFireCooldown -= (float)elapsedTime.TotalSeconds; if (rapidFireCooldown <= 0) { rapidFireCooldown = 0; primaryWeapon.SetCoolDown(0.2f); } } if (invincibilityCooldown > 0) { invincibilityCooldown -= (float)elapsedTime.TotalSeconds; if (invincibilityCooldown <= 0) { invincibilityCooldown = 0; invincible = false; } } rotation = Matrix.CreateTranslation(new Vector3(-origin, 0.0f)) * Matrix.CreateRotationZ(theta) * Matrix.CreateTranslation(new Vector3(position, 0.0f)); boundingRectangle = CalculateBoundingRectangle(new Rectangle(0, 0, texture.Width, texture.Height), rotation); }
public static void Reset() { 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); origin = new Vector2(texture.Width / 2, texture.Height / 2); alive = true; reviving = false; exploding = false; invincible = false; powerUpActive = false; resetInvincibilityCooldown = 1.0f; powerUpType = PowerUpType.None; fragCannon = new FragmentationBombCannon(true); primaryWeapon = standardCannon; secondaryWeapon = fragCannon; if (AeroGame.Troll == true) { lives = 42; currentShield = maxShield; percentShield = (int)((currentShield / maxShield) * 100); } else { speed = 200.0f; velocity = new Vector2(speed); lives = 3; mainWeaponPower = 10; currentShield = 30; maxShield = 30; percentShield = (int)((currentShield / maxShield) * 100); scoreSystem = new ScoreSystem(); } stringMainWeaponPower = mainWeaponPower.ToString(); stringShield = percentShield.ToString() + "%"; stringLives = "x" + lives.ToString(); }
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; }