public override void Collide(PoorSceneObject collidingWith) { base.Collide(collidingWith); if (SceneGraphManager.TypeMatch(collidingWith.GetType(), typeof(EnemyAirplane))) { ParticleManager.ProjectileHit.AddParticles(new Vector2(Position.X - 10, Position.Y)); SoundFxLibrary.GetFx("hitplane1").Play(SoundFxManager.GetVolume("Sound", CalcHelper.CalcVolume(Position) * 0.05f), CalcHelper.RandomBetween(-0.5f, 0.1f), CalcHelper.CalcPan(Position).X * 1.8f); } else if (SceneGraphManager.TypeMatch(collidingWith.GetType(), typeof(PlayerAirplane))) { ParticleManager.ProjectileHit.AddParticles(new Vector2(Position.X - 10, Position.Y)); SoundFxLibrary.GetFx("hitplane2").Play(SoundFxManager.GetVolume("Sound", CalcHelper.CalcVolume(Position) * 0.65f), CalcHelper.RandomBetween(-0.5f, 0.4f), CalcHelper.CalcPan(Position).X * 1.8f); } }
public override void Collide(PoorSceneObject collidingWith) { if (IsCrashing) return; if (SceneGraphManager.TypeMatch(collidingWith.GetType(), typeof(Projectile))) { Projectile proj = (Projectile)collidingWith; TakeDamage(proj.Damage); } else if (SceneGraphManager.TypeMatch(collidingWith.GetType(), typeof(EnemyAirplane)) || SceneGraphManager.TypeMatch(collidingWith.GetType(), typeof(GroundVehicle))) { Kill(); IsDead = true; AirExplode(); } }
public override void Collide(PoorSceneObject collidingWith) { base.Collide(collidingWith); if (SceneGraphManager.TypeMatch(collidingWith.GetType(), typeof(Airplane))) { ParticleManager.ShrapnelExplosion.AddParticles(new Vector2(Position.X - 10, Position.Y), 0f, 360f); ParticleManager.Explosion.AddParticles(Position); SoundFxLibrary.GetFx("bomb4").Play(SoundFxManager.GetVolume("Sound", CalcHelper.CalcVolume(Position) * 0.7f), CalcHelper.RandomBetween(-0.5f, 0.2f), CalcHelper.CalcPan(Position).X * 1.8f); } SoundFxManager.RemoveFx(_soundFX_id); ParticleManager.GroundExplosion.AddParticles(Position, 0, 35); }
public override void Collide(PoorSceneObject collidingWith) { if (!IsCrashing && _health > 0 && SceneGraphManager.TypeMatch(collidingWith.GetType(), typeof(Projectile))) { Projectile p = (Projectile)collidingWith; _health -= p.Damage; if (_health <= 0) { _health = 0; IsCrashing = true; EngineManager.Score += 1; } } else if (SceneGraphManager.TypeMatch(collidingWith.GetType(), typeof(Airplane))) { Airplane e = (Airplane)(collidingWith); // Is the other plane crashing? if (e.IsCrashing) { EngineManager.Score += 2; } _health = 0; AirExplode(); } else if (SceneGraphManager.TypeMatch(collidingWith.GetType(), typeof(GroundVehicle))) { if (IsCrashing) { EngineManager.Score += 2; } ((GroundVehicle)collidingWith).TakeDamage(10000); _health = 0; AirExplode(); } }
public override void Collide(PoorSceneObject collidingWith) { if (SceneGraphManager.TypeMatch(collidingWith.GetType(), typeof(Projectile))) { Projectile proj = (Projectile)collidingWith; TakeDamage(proj.Damage); } if (SceneGraphManager.TypeMatch(collidingWith.GetType(), typeof(Airplane)) && !SceneGraphManager.TypeMatch(this.GetType(), typeof(BossAntiAir)) && _type != "burgerboss") { TakeDamage(10000000); EngineManager.Score += 2; // Bonus points for being killed by crashing airplane } }