示例#1
0
 public override void Notify()
 {
     if (this.IsValidCollision())
     {
         ExplosionManager.GetPlayerExplosion(this.pPlayer);
         PlayerManager.PlayerDead();
     }
 }
示例#2
0
        static public GameObject GetPlayerExplosion()
        {
            ExplosionManager pMan = ExplosionManager.PrivGetInstance();

            Debug.Assert(pMan != null);

            return(pMan.pPlayerExpld);
        }
示例#3
0
        static public void DeactiveExplosion(GameObject pObj)
        {
            Debug.Assert(pObj != null);

            ExplosionManager pMan = ExplosionManager.PrivGetInstance();

            Debug.Assert(pMan != null);

            pObj.RemoveFromSpriteBatch();
            pMan.pGrid.RemoveFromHeadAndLast(pObj);
        }
示例#4
0
        public override void Notify()
        {
            if (IsValidCollision() && !this.pBomb.isDead)
            {
                pBomb.isDead = true;

                ExplosionManager.GetBombExplosion(this.pBomb);

                DelayRemoveManager.Attach(new RemoveBombObserver(this));
            }
        }
示例#5
0
        static public void GetPlayerExplosion(GameObject pObj)
        {
            Debug.Assert(pObj != null);

            ExplosionManager pMan = ExplosionManager.PrivGetInstance();

            Debug.Assert(pMan != null);

            pMan.pPlayerExpld.x = pObj.x;
            pMan.pPlayerExpld.y = pObj.y;
            pMan.pSprite.Attach(pMan.pPlayerExpld.pProxySprite);
        }
示例#6
0
        static public void Create(ExplosionGroup pGroup)
        {
            Debug.Assert(pGroup != null);

            if (pInstance == null)
            {
                pInstance = new ExplosionManager();
            }
            Debug.Assert(pInstance != null);

            pInstance.pGrid = pGroup;
            pInstance.pGrid.Add(pInstance.pPlayerExpld);
        }
示例#7
0
 public override void Notify()
 {
     if (this.IsValidCollision())
     {
         if (this.pAlien.isDead == false)
         {
             SoundManager.Play(Sound.Name.AlienExplode);
             this.pAlien.isDead = true;
             ExplosionManager.GetAlienExplosion(this.pAlien);
             DelayRemoveManager.Attach(new RemoveAlienObserver(this));
         }
     }
 }
示例#8
0
        public override void Notify()
        {
            if (this.IsValidCollision())
            {
                if (this.isMissileHit == true)
                {
                    ExplosionManager.GetUFOExplosion(this.pUFO);
                }
                UFOManager.DeactiveUFO();

                float    time   = pRandom.Next(10, 16);
                SpawnUFO pSpawn = new SpawnUFO();
                TimerManager.Add(TimeEvent.Name.SpawnBomb, pSpawn, time);
            }
        }
示例#9
0
        static public void GetUFOExplosion(GameObject pObj)
        {
            Debug.Assert(pObj != null);

            ExplosionManager pMan = ExplosionManager.PrivGetInstance();

            Debug.Assert(pMan != null);

            UFOExplosion pExplosion = new UFOExplosion(GameObject.Name.UFOExplosion, GameSprite.Name.UFO_Explosion, pObj.x, pObj.y - 10.0f);

            pMan.pGrid.Add(pExplosion);
            pMan.pSprite.Attach(pExplosion.pProxySprite);

            RemoveEffect pRemove = new RemoveEffect(pExplosion);

            TimerManager.Add(TimeEvent.Name.AnimationSprite, pRemove, 1.0f);
        }
示例#10
0
        public override void ShootMissile(Player pPlayer)
        {
            if (!PlayerManager.GetPlayerDeadOrAlive())
            {
                GameObject explosion = ExplosionManager.GetPlayerExplosion();
                pPlayer.x = explosion.x;
                pPlayer.y = explosion.y;
                PlayerManager.SetPlayerAlive();

                GameObject p = PlayerManager.GetMissile();
                p.x = -10;

                explosion.x = -100;
                explosion.y = -100;
                this.Handle(pPlayer);
            }
        }
        //----------------------------------------------------------------------------------
        // Constructor
        //----------------------------------------------------------------------------------
        public ExplosionFactory(SpriteNodeBatch.Name spriteBatchName, SpriteNodeBatch.Name boxSpriteBatchName)
        {
            this.pSpriteBatch = SpriteNodeBatchManager.Find(spriteBatchName);
            Debug.Assert(this.pSpriteBatch != null);

            this.pCollisionSpriteBatch = SpriteNodeBatchManager.Find(boxSpriteBatchName);
            Debug.Assert(this.pCollisionSpriteBatch != null);


            // For managing / recycling the created Explosions
            this.pManager = new ExplosionManager(this, 3, 1);


            // Create at least on of each Explosion type
            // Should be in active
            this.Create(GameObject.Name.AlienExplosion, -100.0f, -100.0f);
            this.Create(GameObject.Name.MissileExplosion, -100.0f, -100.0f);
            this.Create(GameObject.Name.BombExplosion, -100.0f, -100.0f);
        }
示例#12
0
 public override void VisitPlayer(Player p)
 {
     ExplosionManager.GetPlayerExplosion(p);
     PlayerManager.PlayerDead();
 }
示例#13
0
 public override void Execute(float deltaTime)
 {
     ExplosionManager.DeactiveExplosion(this.pObj);
 }