public override void Notify() { //when this notify is called we swap the images and draw it to the alien spritebatch //then maybe add a time event that..... removes it somehow... remove from spritebatch after a half second GameObject pObject = this.pSubject.pObjB; Debug.Assert(pObject != null); GameSprite pShipSplat = GameSpriteMan.Find(GameSprite.Name.ShipSplat); //future concept //pObject.GetProxy().SetRealSprite(this.pSprite); //get the locations and render the image //I'm really upset about this........ but here we are creating a new pShipSplat.PosX(pObject.x); pShipSplat.PosY(pObject.y); pShipSplat.Update(); SpriteBatch pSB_Aliens = SpriteBatchMan.Find(SpriteBatch.Name.Aliens); pSB_Aliens.Attach(pShipSplat); TimerMan.Add(TimeEvent.Name.SplatAnim, new SplatAnim(pShipSplat, pSB_Aliens), 0.5f); }
public AnimationSprite(GameSprite.Name spriteName) { this.pSprite = GameSpriteMan.Find(spriteName); Debug.Assert(this.pSprite != null); this.pCurrImage = null; this.poHeadImage = null; }
public override void execute() { this.pBomb.getProxySprite().setGameSprite(GameSpriteMan.Find(GameSprite.Name.Bomb_Explosion)); ExplosionEvent pExplosionEvent = new ExplosionEvent(this.pBomb); TimerMan.Add(TimeEvent.Name.ExplosionEvent, pExplosionEvent, 0.1f); }
public override void Notify() { GameObject pObject = this.pSubject.pObjB; Debug.Assert(pObject != null); GameSprite pUFOSplat = GameSpriteMan.Find(GameSprite.Name.UFOsplat); //future concept //pObject.GetProxy().SetRealSprite(this.pSprite); //get the locations and render the image pUFOSplat.PosX(pObject.x); pUFOSplat.PosY(pObject.y); pUFOSplat.Update(); SpriteBatch pSB_Aliens = SpriteBatchMan.Find(SpriteBatch.Name.Aliens); pSB_Aliens.Attach(pUFOSplat); TimerMan.Add(TimeEvent.Name.SplatAnim, new SplatAnim(pUFOSplat, pSB_Aliens), 0.5f); }
public void Set(GameSprite.Name name) { this.x = 0.0f; this.y = 0.0f; this.pSprite = GameSpriteMan.Find(name); Debug.Assert(this.pSprite != null); }
public static void Dump() { GameSpriteMan pMan = GameSpriteMan.PrivGetInstance(); Debug.Assert(pMan != null); pMan.BaseDump(); }
public void Dump() { //GameSpriteMan pMan = GameSpriteMan.privGetInstance(); GameSpriteMan pMan = GameSpriteMan.pActiveGSMan; Debug.Assert(pMan != null); pMan.baseDump(); }
public static void Remove(GameSprite pSNode) { GameSpriteMan pSMan = GameSpriteMan.PrivGetInstance(); Debug.Assert(pSMan != null); Debug.Assert(pSNode != null); pSMan.BaseRemove(pSNode); }
// public public static void Create(int init = 2, int delta = 2) { if (pMan == null) { pMan = new GameSpriteMan(init, delta); } GameSpriteMan.Add(GameSprite.Name.Sprite_NullObject, Image.Name.Img_NullObject, 0, 0, 0, 0); }
public static void Remove(GameSprite pNode) { GameSpriteMan pMan = GameSpriteMan.privGetInstance(); Debug.Assert(pMan != null); Debug.Assert(pNode != null); pMan.baseRemove(pNode); }
public AnimateCrab(Animation.Name animName, GameSprite.Name spriteName) : base(animName) { this.poFirstImage = null; this.pCurrentImage = null; this.pSprite = GameSpriteMan.Find(spriteName); Debug.Assert(this.pSprite != null); }
//--------------------------------------------------------------------------------------------------------- // Constructor //--------------------------------------------------------------------------------------------------------- public AnimationSprite(GameSprite.Name name) { this.pGameSprite = GameSpriteMan.Find(name); Debug.Assert(this.pGameSprite != null); this.poFirstImage = null; this.pCurrImage = null; this.poFirstSound = null; this.pCurrSound = null; }
private void PrivStatDump() { GameSpriteMan pSMan = GameSpriteMan.PrivGetInstance(); Debug.Assert(pSMan != null); Debug.WriteLine(""); Debug.WriteLine("GameSprite Manager Stats------------------------------"); pSMan.BaseStatDump(); }
public void Set(GameSprite.Name name) { this.x = 0.0f; this.y = 0.0f; this.sx = 1.0f; this.sy = 1.0f; this.name = ProxySprite.Name.Proxy; this.pSprite = GameSpriteMan.Find(name); Debug.Assert(this.pSprite != null); }
public void Remove(GameSprite pNode) { //GameSpriteMan pMan = GameSpriteMan.privGetInstance(); GameSpriteMan pMan = GameSpriteMan.pActiveGSMan; Debug.Assert(pMan != null); Debug.Assert(pNode != null); pMan.baseRemove(pNode); }
public static void Destroy() { GameSpriteMan pMan = GameSpriteMan.privGetInstance(); Debug.Assert(pMan != null); // Do something clever here // track peak number of active nodes // print stats on destroy // invalidate the singleton }
//---------------------------------------------------------------------- // Static Methods //---------------------------------------------------------------------- //public static void Create(int reserveNum = 3, int reserveGrow = 1) //{ // Debug.Assert(reserveNum > 0); // Debug.Assert(reserveGrow > 0); // Debug.Assert(pInstance == null); // if (pInstance == null) // { // pInstance = new GameSpriteMan(reserveNum, reserveGrow); // } // // Add a NULL Sprite into the Manager, allows find // GameSprite pGSprite = GameSpriteMan.Add(GameSprite.Name.NullObject, Image.Name.NullObject, 0, 0, 0, 0); // Debug.Assert(pGSprite != null); //} public static void Create() { // initialize the singleton here Debug.Assert(pInstance == null); // Do the initialization if (pInstance == null) { pInstance = new GameSpriteMan(); } }
public static void Remove(GameSprite pGameSprite) { //ensure call Create() first GameSpriteMan pMan = GameSpriteMan.GetInstance(); Debug.Assert(pMan != null); // ensure pGameSprite is not null Debug.Assert(pGameSprite != null); pMan.baseRemove(pGameSprite); }
public static void Remove(GameSprite.Name name) { GameSpriteMan pMan = GameSpriteMan.PrivGetInstance(); Debug.Assert(pMan != null); GameSprite pNode = Find(name); Debug.Assert(pNode != null); pMan.BaseRemove(pNode); }
//----------------------------------------------------------------------------- // Game::UnLoadContent() // unload content (resources loaded above) // unload all content that was loaded before the Engine Loop started //----------------------------------------------------------------------------- public override void UnLoadContent() { GameObjectMan.Destory(); ProxySpriteMan.Destory(); TimerMan.Destory(); SpriteBatchMan.Destory(); GameSpriteMan.Destory(); BoxSpriteMan.Destory(); ImageMan.Destory(); TextureMan.Destory(); }
public static GameSprite Find(GameSprite.Name name) { GameSpriteMan pSMan = GameSpriteMan.PrivGetInstance(); Debug.Assert(pSMan != null); pSMan.poNodeCompare.SetName(name); GameSprite pSNode = (GameSprite)pSMan.BaseFind(pSMan.poNodeCompare); return(pSNode); }
public static void Destory() { //ensure call Create() first GameSpriteMan pMan = GameSpriteMan.GetInstance(); Debug.Assert(pMan != null); pMan.baseDestory(); pMan.poNodeForCompare = null; GameSpriteMan.pInstance = null; }
public static GameSprite Find(GameSprite.Name name) { //ensure call Create() first GameSpriteMan pMan = GameSpriteMan.GetInstance(); Debug.Assert(pMan != null); pMan.poNodeForCompare.setName(name); GameSprite pData = (GameSprite)pMan.baseFind(pMan.poNodeForCompare); return(pData); }
public static GameSprite Find(GameSprite.Name name) { GameSpriteMan pMan = GameSpriteMan.PrivGetInstance(); Debug.Assert(pMan != null); pMan.poNodeCompare.name = name; GameSprite pData = (GameSprite)pMan.BaseFind(pMan.poNodeCompare); return(pData); }
public BlueAlienAnimationCommand(GameSprite.Name spriteName) { // initialized the sprite animation is attached to this.pSprite = GameSpriteMan.Find(spriteName); Debug.Assert(this.pSprite != null); // initialize references this.pCurrImage = null; // list this.poFirstImage = null; }
public static void SetActive(GameSpriteMan pGSMan) { GameSpriteMan pMan = GameSpriteMan.privGetInstance(); Debug.Assert(pMan != null); Debug.Assert(pGSMan != null); GameSpriteMan.pActiveGSMan = pGSMan; // Add a NULL Sprite into the Manager, allows find GameSprite pGSprite = GameSpriteMan.Add(GameSprite.Name.NullObject, Image.Name.NullObject, 0, 0, 0, 0); Debug.Assert(pGSprite != null); }
public override void execute() { Ship pRealShip = (Ship)this.pShip; pRealShip.setState(ShipMan.State.End); pRealShip.setPositionState(ShipMan.State.Stay); pRealShip.getProxySprite().setGameSprite(GameSpriteMan.Find(GameSprite.Name.Ship_Explosion1)); AnimationExplosion pAnimExplosion = new AnimationExplosion(pRealShip, 1.0f); pAnimExplosion.attach(Image.Name.Ship_Explosion2); pAnimExplosion.attach(Image.Name.Ship_Explosion1); TimerMan.Add(TimeEvent.Name.ExplosionEvent, pAnimExplosion, 0.3f); //this.pShip.remove(); }
public static void Create(int reserveNum, int growth) { Debug.Assert(reserveNum > 0); Debug.Assert(growth > 0); Debug.Assert(pInstance == null); if (pInstance == null) { pInstance = new GameSpriteMan(reserveNum, growth); } GameSprite pGSprite = GameSpriteMan.Add(GameSprite.Name.NullObject, Image.Name.NullObject, 0, 0, 0, 0); Debug.Assert(pGSprite != null); }
public static void Destroy() { //GameSpriteMan pMan = GameSpriteMan.privGetInstance(); GameSpriteMan pMan = GameSpriteMan.pActiveGSMan; Debug.Assert(pMan != null); // Print stats on destroy pMan.baseDump(); // Invalidate the singleton if (pInstance != null) { pInstance = null; } }
public static GameSprite Find(GameSprite.Name name) { GameSpriteMan pMan = GameSpriteMan.privGetInstance(); Debug.Assert(pMan != null); // Compare functions only compares two Nodes // So: Use the Compare Node - as a reference // use in the Compare() function pMan.poNodeCompare.SetName(name); GameSprite pData = (GameSprite)pMan.baseFind(pMan.poNodeCompare); return(pData); }