Esempio n. 1
0
        public static void DeactivateCollisionBoxes()
        {
            // Remove Bombs
            GameObject             bombRoot = GameObjectManager.Find(GameObjectName.BombRoot);
            PCSTreeReverseIterator iterBomb = new PCSTreeReverseIterator(bombRoot);
            GameObject             pGoBomb  = (GameObject)iterBomb.First();

            while (!iterBomb.IsDone())
            {
                pGoBomb.DeactivateCollisionSprite();
                pGoBomb = (GameObject)iterBomb.Next();
            }
            GameObject             missileRoot = GameObjectManager.Find(GameObjectName.MissileRoot);
            PCSTreeReverseIterator iterMissile = new PCSTreeReverseIterator(missileRoot);
            GameObject             pGOMissile  = (GameObject)iterMissile.First();

            while (!iterMissile.IsDone())
            {
                pGOMissile.DeactivateCollisionSprite();
                pGOMissile = (GameObject)iterMissile.Next();
            }

            // Remove Shields
            for (int i = 1; i < 5; ++i)
            {
                GameObject             shieldRoot = GameObjectManager.Find(GameObjectName.ShieldRoot, i);
                PCSTreeReverseIterator iter       = new PCSTreeReverseIterator(shieldRoot);
                GameObject             pGO        = (GameObject)iter.First();
                while (!iter.IsDone())
                {
                    pGO.DeactivateCollisionSprite();
                    pGO = (GameObject)iter.Next();
                }
            }

            // Remove Alien Grid
            GameObject             grid     = GameObjectManager.Find(GameObjectName.Grid);
            PCSTreeReverseIterator iterGrid = new PCSTreeReverseIterator(grid);
            GameObject             pGameObj = (GameObject)iterGrid.First();

            while (!iterGrid.IsDone())
            {
                pGameObj.DeactivateCollisionSprite();
                pGameObj = (GameObject)iterGrid.Next();
            }
        }