Example #1
0
 public override void Collide(PoorSceneObject collidingWith)
 {
     base.Collide(collidingWith);
     if (SceneGraphManager.TypeMatch(collidingWith.GetType(), typeof(Airplane)))
     {
         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);
     }
 }
Example #2
0
 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);
 }
Example #3
0
 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();
     }
 }
Example #4
0
        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();
            }
        }
Example #5
0
 public virtual void Collide(PoorSceneObject collidingWith)
 {
 }
Example #6
0
        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
            }
        }
Example #7
0
 public override void Collide(PoorSceneObject collidingWith)
 {
     SceneGraphManager.RemoveObject(this);
 }
Example #8
0
 public static void RemoveObject(PoorSceneObject oldObject)
 {
     foreach (SceneObjectNode node in _root.Nodes)
     {
         if (node.SceneObject == oldObject)
         {
             if (removeQueue.Contains(node))
                 return;
             removeQueue.Enqueue(node);
             if (TypeMatch(node.SceneObject.GetType(), typeof(IPoorEnemy)))
             {
                 LevelManager.CurrentLevel.RemoveEnemy(node.SceneObject);
             }
             return;
         }
     }
 }
Example #9
0
        public static void AddObject(PoorSceneObject newObject)
        {
            SceneObjectNode node = new SceneObjectNode(newObject);

            node.LoadContent(); // this or crash in node.Draw
            _new.Enqueue(node);

            newObjectsAdded = true;
        }
Example #10
0
 public static void Update(GameTime gameTime, PoorSceneObject obj)
 {
 }
Example #11
0
 public static void UnregisterObject(PoorSceneObject obj)
 {
     _objects.Remove(obj);
 }
Example #12
0
 public static void RegisterObject(PoorSceneObject obj)
 {
     _objects.Add(obj);
 }