Exemplo n.º 1
0
        private static Ship ActivateShip()
        {
            ShipMan pShipMan = ShipMan.PrivInstance();

            Debug.Assert(pShipMan != null);

            // copy over safe copy
            Ship pShip = new Ship(GameObject.Name.Ship, GameSprite.Name.Ship, 400, 120);

            pShipMan.pShip = pShip;

            // Attach the sprite to the correct sprite batch
            SpriteNodeBatch pSB_Player = SpriteNodeBatchManager.Find(SpriteNodeBatch.Name.Players);

            pSB_Player.Attach(pShip.pProxySprite);

            // Attach the missile to the missile root
            GameObject pShipRoot = GameObjectManager.Find(GameObject.Name.ShipRoot);

            Debug.Assert(pShipRoot != null);

            // Add to GameObject Tree - {update and collisions}
            pShipRoot.Add(pShipMan.pShip);

            return(pShipMan.pShip);
        }
Exemplo n.º 2
0
        //----------------------------------------------------------------------------------
        // Activate Methods
        //----------------------------------------------------------------------------------
        public void ActivateCollisionSprite(SpriteNodeBatch pSpriteBatch)
        {
            Debug.Assert(pSpriteBatch != null);
            Debug.Assert(this.poCollObj != null);

            pSpriteBatch.Attach(this.poCollObj.pCollSprite);
        }
Exemplo n.º 3
0
        public void AddExplosion()
        {
            // Find the correct Batch
            SpriteNodeBatch pBatch = SpriteNodeBatchManager.Find(SpriteNodeBatch.Name.Explosions);

            //Delegate to batches attach which calls its own SpriteNodeManager's Attach
            // Inside the SpriteNodeManager's Attach is where the back pointer is set.
            pBatch.Attach(this.pProxySprite);
        }
Exemplo n.º 4
0
        public static Font Add(Font.Name fontName, SpriteNodeBatch.Name SpriteBatch_Name, String pMessage, Glyph.Name glyphName, float px, float py)
        {
            FontManager pManager = FontManager.privGetInstance();

            Font pNode = (Font)pManager.baseAdd();

            Debug.Assert(pNode != null);

            pNode.Set(fontName, pMessage, glyphName, px, py);

            // Add to sprite batch
            SpriteNodeBatch pSriteBatch = SpriteNodeBatchManager.Find(SpriteBatch_Name);

            Debug.Assert(pSriteBatch != null);
            Debug.Assert(pNode.pFontSprite != null);
            pSriteBatch.Attach(pNode.pFontSprite);

            return(pNode);
        }
Exemplo n.º 5
0
 public void ActivateGameSprite(SpriteNodeBatch pSpriteBatch)
 {
     Debug.Assert(pSpriteBatch != null);
     pSpriteBatch.Attach(this.pProxySprite);
 }