示例#1
0
 public AlienGO(GameObject.Name gameName, GameSprite.Name spriteName, GameSprite.Name expSpriteName, int points, float x, float y)
     : base(gameName, spriteName)
 {
     this.x          = x;
     this.y          = y;
     this.delta      = 1.0f;
     this.points     = points;
     this.pExplosion = ProxySpriteManager.Add(expSpriteName);
 }
示例#2
0
        //----------------------------------------------------------------------------------
        // Set Methods
        //----------------------------------------------------------------------------------

        public void Set(GameObject.Name gameName, GameSprite.Name spriteName, float px = 0.0f, float py = 0.0f)
        {
            this.name = gameName;
            this.x    = px;
            this.y    = py;

            this.pProxySprite = ProxySpriteManager.Add(spriteName);
            this.poCollObj    = new CollisionObj(this.pProxySprite);
            Debug.Assert(this.poCollObj != null);
            this.bMarkForDeath = false;
        }
        //SpriteNode pBackPointer;

        public ExplosionSprite(GameSprite.Name spriteName, float px, float py) : base()
        {
            // finds the ProxySprite and returns a reference to it.
            // the sprite base of the proxy sprite has a back pointer to its spritenode
            this.pProxySprite = ProxySpriteManager.Add(spriteName);

            this.pProxySprite.SetCoordinates(px, py);
            this.pProxySprite.Update();

            this.pExplosionBatch = SpriteNodeBatchManager.Find(SpriteNodeBatch.Name.Explosions);
        }
示例#4
0
        public GameObject(GameObject.Name gameName, GameSprite.Name spriteName) : base()
        {
            this.name = gameName;
            this.x    = 0.0f;
            this.y    = 0.0f;

            this.pProxySprite = ProxySpriteManager.Add(spriteName);
            this.poCollObj    = new CollisionObj(this.pProxySprite);
            Debug.Assert(this.poCollObj != null);
            this.bMarkForDeath = false;
        }
示例#5
0
 protected GameObject(GameObjectName goName, SpriteBaseName spriteName, int idx)
 {
     this.gameObjectName = goName;
     this.index          = idx;
     this.markedForDeath = false;
     this.x            = 0.0f;
     this.y            = 0.0f;
     this.pProxySprite = ProxySpriteManager.Add(spriteName);
     Debug.Assert(this.pProxySprite != null);
     this.pCollisionObject = new CollisionObject(this.pProxySprite);
     Debug.Assert(this.pCollisionObject != null);
 }
示例#6
0
 //--------------------------------------------------------------------------------------------
 // Constructor
 //--------------------------------------------------------------------------------------------
 protected GameObject(GameObject.Name gameObjectName, GameSprite.Name gameSpriteName)
 {
     this.name = gameObjectName;
     this.x = 0.0f;
     this.y = 0.0f;
     this.sx = 1.0f;
     this.sy = 1.0f;
     this.pProxySprite = ProxySpriteManager.Add(gameSpriteName);
     Debug.Assert(this.pProxySprite != null);
     this.pColObject = new CollisionObject(this.pProxySprite);
     Debug.Assert(this.pColObject != null);
     this.isDead = false;
 }
示例#7
0
        protected GameObject(GameObject.Name objName, GameSprite.Name spriteName, int _index)
        {
            this.name  = objName;
            this.index = _index;
            this.x     = 0.0f;
            this.y     = 0.0f;

            this.markForDeath = false;

            //this.pProxySprite = new ProxySprite(spriteName);
            this.pProxySprite = ProxySpriteManager.Add(spriteName);
            Debug.Assert(this.pProxySprite != null);

            this.poColObj = new ColObject(this.pProxySprite);
            Debug.Assert(this.poColObj != null);
        }
        public static void Create(int startReserveSize = 3, int refillSize = 1)
        {
            // make sure values are ressonable
            Debug.Assert(startReserveSize > 0);
            Debug.Assert(refillSize > 0);

            // initialize the singleton here
            Debug.Assert(pInstance == null);

            // Do the initialization
            if (pInstance == null)
            {
                pInstance = new ProxySpriteManager(startReserveSize, refillSize);

                // Add a NULL Sprite into the Manager, allows find to work without breaking;
                ProxySprite pPSprite = ProxySpriteManager.Add(GameSprite.Name.NullObject);
                Debug.Assert(pPSprite != null);
            }

            Debug.WriteLine("------ProxySprite Manager Initialized-------");
        }
示例#9
0
 public void SetGameSprite(GameSprite.Name spriteName)
 {
     this.pProxySprite = ProxySpriteManager.Add(spriteName);
 }
示例#10
0
        // pProxy has a back pointer

        //public SpriteNodeManager pBackPointer_SpriteNodeManager;



        public ExplosionSprite(GameSprite.Name spriteName)
        {
            // finds the ProxySprite and returns a reference to it.
            this.pProxySprite = ProxySpriteManager.Add(spriteName);
        }