public override void Notify() { if (this.IsValidCollision()) { ExplosionManager.GetPlayerExplosion(this.pPlayer); PlayerManager.PlayerDead(); } }
static public GameObject GetPlayerExplosion() { ExplosionManager pMan = ExplosionManager.PrivGetInstance(); Debug.Assert(pMan != null); return(pMan.pPlayerExpld); }
static public void DeactiveExplosion(GameObject pObj) { Debug.Assert(pObj != null); ExplosionManager pMan = ExplosionManager.PrivGetInstance(); Debug.Assert(pMan != null); pObj.RemoveFromSpriteBatch(); pMan.pGrid.RemoveFromHeadAndLast(pObj); }
public override void Notify() { if (IsValidCollision() && !this.pBomb.isDead) { pBomb.isDead = true; ExplosionManager.GetBombExplosion(this.pBomb); DelayRemoveManager.Attach(new RemoveBombObserver(this)); } }
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); }
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); }
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)); } } }
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); } }
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); }
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); }
public override void VisitPlayer(Player p) { ExplosionManager.GetPlayerExplosion(p); PlayerManager.PlayerDead(); }
public override void Execute(float deltaTime) { ExplosionManager.DeactiveExplosion(this.pObj); }