public override void Die(CVGameTime gameTime) { CurrentStage.AddExplosion(this.BoundingBox().Center.ToVector() - new Vector2(ExplosionAnimation.FrameWidth / 2, ExplosionAnimation.FrameHeight / 2), ExplosionAnimation, ExplosionSound); IsDead = true; VulnerableToBullets = false; CollisionIsHazardous = false; }
public override void Die(CVGameTime gameTime) { IsDead = true; Active = false; Vector2 firstExplosionPosition = this.WorldPosition; CurrentStage.AddExplosion(firstExplosionPosition + new Vector2(0, 0), ExplosionAnimation.CreateCopy(), ExplosionSound, 0); CurrentStage.AddExplosion(firstExplosionPosition + new Vector2(-15, -10), ExplosionAnimation.CreateCopy(), ExplosionSound, 100); CurrentStage.AddExplosion(firstExplosionPosition + new Vector2(-15, 10), ExplosionAnimation.CreateCopy(), null, 200); CurrentStage.AddExplosion(firstExplosionPosition + new Vector2(5, -10), ExplosionAnimation.CreateCopy(), ExplosionSound, 300); CurrentStage.AddExplosion(firstExplosionPosition + new Vector2(5, 10), ExplosionAnimation.CreateCopy(), null, 400); CurrentStage.AddExplosion(firstExplosionPosition + new Vector2(25, -10), ExplosionAnimation.CreateCopy(), ExplosionSound, 500); CurrentStage.AddExplosion(firstExplosionPosition + new Vector2(25, 10), ExplosionAnimation.CreateCopy(), null, 600); CurrentStage.AddExplosion(firstExplosionPosition + new Vector2(45, -10), ExplosionAnimation.CreateCopy(), ExplosionSound, 700); CurrentStage.AddExplosion(firstExplosionPosition + new Vector2(45, 10), ExplosionAnimation.CreateCopy(), null, 800); CurrentStage.AddExplosion(firstExplosionPosition + new Vector2(65, -10), ExplosionAnimation.CreateCopy(), ExplosionSound, 900); CurrentStage.AddExplosion(firstExplosionPosition + new Vector2(65, 10), ExplosionAnimation.CreateCopy(), null, 1000); foreach (var tile in CurrentStage.StageTiles.Where(t => t.DestructionLayer1GID > 0)) { tile.Status = StageTile.TileStatus.Destroyed; } CurrentStage.StartComplete(gameTime, this); }
private void ExplodeBridgePiece(int iPiece) { bridgepieces[iPiece].Status = StageTile.TileStatus.Destroyed; bridgepieces[iPiece].MetaGID = 0; bridgepieces[iPiece].BackgroundGID = 0; bridgepieces[iPiece].CollisionType = StageTile.TileCollisionType.None; Animation explosion = new Animation(); Vector2 explosionLocation = new Vector2(this.WorldPosition.X + (iPiece * CurrentStage.TileWidth), this.WorldPosition.Y); explosion.Initialize(_explosionAnimationStrip, explosionLocation, 32, 32, 5, 150, Color.White, 1f, false, false, CurrentStage); CurrentStage.AddExplosion(explosionLocation, explosion, _explosionSound); _explosionSoundInstance = _explosionSound.CreateInstance(); _explosionSoundInstance.Play(); }
public override void Die(CVGameTime gameTime) { CurrentStage.AddExplosion(this.WorldPosition, this.ExplosionAnimation, this.ExplosionSound); Active = false; // do nothing }