예제 #1
0
        public Ship createShip(Ship.ShipType mShipType, GameObject.GameObjectName gameName, int index = 0, float mX = 0.0f, float mY = 0.0f)
        {
            Ship ship = null;

            switch (mShipType)
            {
            case Ship.ShipType.ShipRoot:
                ship = new ShipRoot(gameName, Sprite.SpriteName.NullObject, index, mX, mY);
                GameObjectNodeManager.add(ship, cPCSTree);
                break;

            case Ship.ShipType.CannonShip:
                ship = new CannonShip(gameName, Sprite.SpriteName.CannonShip, index, mX, mY);

                //   ship = cannonShip;
                break;

            case Ship.ShipType.Uninitilized:
                Debug.WriteLine("Missile Type is Uninitilized");
                break;
            }

            this.cPCSTree.Insert(ship, this.cParent);

            // cSpriteBatch.addToBatch(ship.getProxySprite());
            // cSpriteBatch.addToBatch(ship.getCollisionObj().cSpriteBox);
            ship.addSpriteToBatch(this.cSpriteBatch);
            ship.addCollisionToBatch(SpriteBatchManager.find(SpriteBatch.SpriteBatchName.Boxes));
            return(ship);
        }
예제 #2
0
        public static void moveToGhostManager()
        {
            GameObjectNodeManager gamMInstance = GameObjectNodeManager.getSingletonInstance();

            Debug.Assert(gamMInstance != null);

            GameObjectNode root = (GameObjectNode)gamMInstance.activeList;

            Debug.Assert(root != null);

            while (root != null)
            {
                PCSTreeReverseIterator pcsTreeIter = new PCSTreeReverseIterator(root.getGameObject());
                Debug.Assert(pcsTreeIter != null);
                if (root.getGameObject().cGameObjectName == GameObject.GameObjectName.AlienGrid)
                {
                    GameObject gameObj = (GameObject)pcsTreeIter.First();
                    while (!pcsTreeIter.IsDone())
                    {
                        gameObj = (GameObject)pcsTreeIter.Next();
                        gameObj.remove();
                    }
                }
                root = (GameObjectNode)root.pNext;
            }
        }
예제 #3
0
        public UFO createUFO(UFO.UFOType mUfoType, GameObject.GameObjectName gameName, int index = 0, float mX = 0.0f, float mY = 0.0f)
        {
            UFO ufo = null;

            switch (mUfoType)
            {
            case UFO.UFOType.UFORoot:
                ufo = new UFORoot(gameName, Sprite.SpriteName.NullObject, index, mX, mY, UFO.UFOType.UFORoot);
                GameObjectNodeManager.add(ufo, cPCSTree);
                break;

            case UFO.UFOType.AlienUFO:
                ufo = new AlienUFO(gameName, Sprite.SpriteName.AlienUFO, index, mX, mY, UFO.UFOType.AlienUFO);
                break;

            case UFO.UFOType.Uninitilized:
                Debug.WriteLine("ufo Type is Uninitilized");
                break;
            }

            this.cPCSTree.Insert(ufo, this.cParent);
            ufo.addSpriteToBatch(this.cSpriteBatch);
            ufo.addCollisionToBatch(SpriteBatchManager.find(SpriteBatch.SpriteBatchName.Boxes));
            return(ufo);
        }
예제 #4
0
        public static void printList()
        {
            GameObjectNodeManager gamMInstance = GameObjectNodeManager.getSingletonInstance();

            Debug.Assert(gamMInstance != null);

            Debug.WriteLine("");
            Debug.WriteLine("------ Active List: ---------------------------\n");

            MLink pNode = gamMInstance.activeList;

            int i = 0;

            while (pNode != null)
            {
                Debug.WriteLine("{0}: -------------", i);
                pNode.print();
                i++;
                pNode = pNode.pNext;
            }

            Debug.WriteLine("");
            Debug.WriteLine("------ Reserve List: ---------------------------\n");

            pNode = gamMInstance.reserveList;
            i     = 0;
            while (pNode != null)
            {
                Debug.WriteLine("{0}: -------------", i);
                i++;
                pNode = pNode.pNext;
            }
        }
예제 #5
0
        public Bomb createBomb(Bomb.BombType mBombType, GameObject.GameObjectName gameName, int index = 0, float mX = 0.0f, float mY = 0.0f)
        {
            Bomb bomb = null;

            switch (mBombType)
            {
            case Bomb.BombType.Flipping:
                bomb = new FlippingBomb(gameName, Sprite.SpriteName.Flipping, index, mX, mY, mBombType);
                break;

            case Bomb.BombType.ZigZag:
                bomb = new ZigZagBomb(gameName, Sprite.SpriteName.ZigZag, index, mX, mY, mBombType);
                break;

            case Bomb.BombType.Plunger:
                bomb = new PlungerBomb(gameName, Sprite.SpriteName.Plunger, index, mX, mY, mBombType);
                break;

            case Bomb.BombType.BombRoot:
                bomb = new BombRoot(gameName, Sprite.SpriteName.NullObject, index, mX, mY, mBombType);
                GameObjectNodeManager.add(bomb, cPCSTree);
                break;

            case Bomb.BombType.Uninitilized:
                Debug.WriteLine("Bomb Type is Uninitilized");
                break;
            }

            activate(bomb);
            return(bomb);
        }
예제 #6
0
        public Missile createMissile(Missile.MissileType mMissileType, GameObject.GameObjectName gameName, int index = 0, float mX = 0.0f, float mY = 0.0f)
        {
            Missile missile = null;

            switch (mMissileType)
            {
            case Missile.MissileType.MissileRoot:
                missile = new MissileRoot(gameName, Sprite.SpriteName.NullObject, index, mX, mY, Missile.MissileType.MissileRoot);
                GameObjectNodeManager.add(missile, cPCSTree);
                break;

            case Missile.MissileType.StraightMissile:
                missile = new StraightMissile(gameName, Sprite.SpriteName.StraightMissile, index, mX, mY, Missile.MissileType.StraightMissile);
                break;

            case Missile.MissileType.Uninitilized:
                Debug.WriteLine("Missile Type is Uninitilized");
                break;
            }

            this.cPCSTree.Insert(missile, this.cParent);
            //  cSpriteBatch.addToBatch(missile.getProxySprite());
            // cSpriteBatch.addToBatch(missile.getCollisionObj().cSpriteBox);
            missile.addSpriteToBatch(this.cSpriteBatch);
            missile.addCollisionToBatch(SpriteBatchManager.find(SpriteBatch.SpriteBatchName.Boxes));
            return(missile);
        }
예제 #7
0
        // Updates all the nodes in the tree
        public static void update()
        {
            GameObjectNodeManager gamMInstance = GameObjectNodeManager.getSingletonInstance();

            Debug.Assert(gamMInstance != null);

            GameObjectNode root = (GameObjectNode)gamMInstance.activeList;

            Debug.Assert(root != null);

            while (root != null)
            {
                // PCSTreeForwardIterator pcsTreeIter = new PCSTreeForwardIterator(root.getGameObject());
                PCSTreeReverseIterator pcsTreeIter = new PCSTreeReverseIterator(root.getGameObject());
                Debug.Assert(pcsTreeIter != null);

                //iterate all the nodes inside the roots
                GameObject gameObj = (GameObject)pcsTreeIter.First();
                while (!pcsTreeIter.IsDone())
                {
                    gameObj.update();
                    gameObj = (GameObject)pcsTreeIter.Next();
                }
                root = (GameObjectNode)root.pNext;
            }
        }
 public override void update(float totalTime)
 {
     //  count++;
     InputManager.update();
     TimerManager.update(totalTime);
     GameObjectNodeManager.update();
     CollisionPairManager.process();
     PlayerManager.update();
 }
예제 #9
0
        public static void createMInstance(int deltaRefillCount = 3, int prefillCount = 5)
        {
            Debug.Assert(deltaRefillCount > 0);
            Debug.Assert(prefillCount > 0);
            if (gamMInstance == null)
            {
                gamMInstance = new GameObjectNodeManager(deltaRefillCount, prefillCount);
            }
            Sprite sprite = SpriteManager.add(Sprite.SpriteName.NullObject, Image.ImageName.NullObject, 0, 0, 1, 1, Unit.blackColor);

            Debug.Assert(gamMInstance != null);
        }
예제 #10
0
        //changed
        public static GameObjectNode add(GameObject mGameObj, PCSTree mTree)
        {
            Debug.Assert(mGameObj != null);
            Debug.Assert(mTree != null);

            GameObjectNodeManager goNInstance = GameObjectNodeManager.getSingletonInstance();

            Debug.Assert(gamMInstance != null);

            GameObjectNode goNode = (GameObjectNode)gamMInstance.genericAdd();

            Debug.Assert(goNode != null);

            goNode.set(mGameObj, mTree);
            return(goNode);
        }
예제 #11
0
        public void remove()
        {
            GameObjectNodeManager.remove(this);
            //Remove from batch
            Debug.Assert(cProxySprite != null);
            SpriteBatchNode sbNode = cProxySprite.getSpriteBatchBNode();

            Debug.Assert(sbNode != null);
            SpriteBatchManager.remove(sbNode);

            ///3 lines commented for ghost Manager
            sbNode = this.cCollisionObj.cSpriteBox.getSpriteBatchBNode();
            Debug.Assert(sbNode != null);
            SpriteBatchManager.remove(sbNode);

            GhostManager.add(this);
        }
예제 #12
0
        public static StraightMissile activateMissile()
        {
            ShipManager shipMan = ShipManager.getSingleton();

            Debug.Assert(shipMan != null);

            GameObjectNode gon     = GameObjectNodeManager.findGameObjectNode(GameObject.GameObjectName.MissileRoot);
            PCSTree        pcsTree = gon.getPCSTree();
            GameObject     gameObj = gon.getGameObject();

            Debug.Assert(pcsTree != null);
            Debug.Assert(gameObj != null);

            // StraightMissile missile = new StraightMissile(GameObject.GameObjectName.StraightMissile, Sprite.SpriteName.Straight, 1, 400, 100f,Missile.MissileType.Straight);

            ///to do
            StraightMissile missile = (StraightMissile)FactoryManager.getMissileFactry().createMissile(Missile.MissileType.StraightMissile, GameObject.GameObjectName.StraightMissile, 1, 300, 200);

            //StraightMissile missile = (StraightMissile)GhostManager.find(GameObject.GameObjectName.StraightMissile);
            //if(missile==null)
            //{
            //   missile = (StraightMissile)FactoryManager.getMissileFactry().createMissile(Missile.MissileType.StraightMissile, GameObject.GameObjectName.StraightMissile, 1, 300, 200);
            //}
            //StraightMissile missile = (StraightMissile)GhostManager.find(GameObject.GameObjectName.StraightMissile);

            shipMan.missile = missile;

            //  SpriteBatch missileBatch = SpriteBatchManager.find(SpriteBatch.SpriteBatchName.Missiles);
            //  SpriteBatch boxBatch = SpriteBatchManager.find(SpriteBatch.SpriteBatchName.Boxes);

            //  Debug.Assert(missileBatch != null);
            //  Debug.Assert(boxBatch != null);

            // missile.addSpriteToBatch(missileBatch);
            //  missile.addCollisionToBatch(boxBatch);
            GameObject pMissileRoot = GameObjectNodeManager.find(GameObject.GameObjectName.MissileRoot);

            Debug.Assert(pMissileRoot != null);
            ///////////////////////////Not sure
            // pcsTree.Insert(missile, pMissileRoot);
            // pcsTree.GetRoot.
            pMissileRoot.update();

            return(missile);
        }
예제 #13
0
        public static void changeColor()
        {
            GameObjectNodeManager gamMInstance = GameObjectNodeManager.getSingletonInstance();

            Debug.Assert(gamMInstance != null);

            GameObjectNode root = (GameObjectNode)gamMInstance.activeList;

            Debug.Assert(root != null);

            while (root != null)
            {
                PCSTreeReverseIterator pcsTreeIter = new PCSTreeReverseIterator(root.getGameObject());
                Debug.Assert(pcsTreeIter != null);
                GameObject gameObj = (GameObject)pcsTreeIter.First();
                while (!pcsTreeIter.IsDone())
                {
                    if (gameObj.cGameObjectName == GameObject.GameObjectName.AlienGrid ||
                        gameObj.cGameObjectName == GameObject.GameObjectName.Column ||
                        gameObj.cGameObjectName == GameObject.GameObjectName.Crab ||
                        gameObj.cGameObjectName == GameObject.GameObjectName.Octopus ||
                        gameObj.cGameObjectName == GameObject.GameObjectName.Squid ||
                        gameObj.cGameObjectName == GameObject.GameObjectName.AlienExplosion ||
                        gameObj.cGameObjectName == GameObject.GameObjectName.UFORoot ||
                        gameObj.cGameObjectName == GameObject.GameObjectName.AlienUFO ||
                        gameObj.cGameObjectName == GameObject.GameObjectName.ShieldGrid ||
                        gameObj.cGameObjectName == GameObject.GameObjectName.ShieldUnit ||
                        gameObj.cGameObjectName == GameObject.GameObjectName.ShieldColumn ||
                        gameObj.cGameObjectName == GameObject.GameObjectName.ShieldBrick ||
                        gameObj.cGameObjectName == GameObject.GameObjectName.BombRoot ||
                        gameObj.cGameObjectName == GameObject.GameObjectName.Bomb ||
                        gameObj.cGameObjectName == GameObject.GameObjectName.MissileRoot ||
                        gameObj.cGameObjectName == GameObject.GameObjectName.StraightMissile ||
                        gameObj.cGameObjectName == GameObject.GameObjectName.CannonShip ||
                        gameObj.cGameObjectName == GameObject.GameObjectName.ShipRoot
                        )
                    {
                        gameObj.cCollisionObj.cSpriteBox.setColor(Unit.spriteBoxColor);
                    }
                    gameObj = (GameObject)pcsTreeIter.Next();
                }
                root = (GameObjectNode)root.pNext;
            }
        }
예제 #14
0
 public override void update(float totalTime)
 {
     for (int i = 0; i < 400; i++)
     {
         if (Azul.Input.GetKeyState((Azul.AZUL_KEY)i))
         {
             if (i == 294)
             {
                 SpriteBatchManager.cleanup();
                 TimerManager.removeAll();
                 GameObjectNodeManager.cleanup();
                 GameManager.setGameState(new GameStartState());
                 GameManager.load();
             }
             break;
         }
     }
     //Console.WriteLine(d);
 }
예제 #15
0
        public static GameObject find(GameObject.GameObjectName mGameObjectName)
        {
            GameObjectNodeManager gamMInstance = GameObjectNodeManager.getSingletonInstance();

            Debug.Assert(gamMInstance != null);

            GameObjectNode pseudoGameObjNode = cGameObjNodeRef;

            Debug.Assert(pseudoGameObjNode != null);

            pseudoGameObjNode.getGameObject().setName(mGameObjectName);

            Debug.Assert(pseudoGameObjNode != null);

            GameObjectNode targetGameObjNode = (GameObjectNode)gamMInstance.genericFind(pseudoGameObjNode);

            Debug.Assert(targetGameObjNode != null);

            return(targetGameObjNode.getGameObject());
        }
예제 #16
0
        public Alien createAlien(Alien.AlienType mAlienType, GameObject.GameObjectName gameName, int index = 0, float mX = 0.0f, float mY = 0.0f)
        {
            Alien alien = null;

            switch (mAlienType)
            {
            case Alien.AlienType.Crab:
                alien = new Crab(gameName, Sprite.SpriteName.Crab, index, mX, mY);
                break;

            case Alien.AlienType.Squid:
                alien = new Squid(gameName, Sprite.SpriteName.Squid, index, mX, mY);
                break;

            case Alien.AlienType.Octopus:
                alien = new Octopus(gameName, Sprite.SpriteName.Octopus, index, mX, mY);
                break;

            case Alien.AlienType.Column:
                alien = new Column(gameName, Sprite.SpriteName.NullObject, index, mX, mY);
                //  columnCount++;
                //  Debug.WriteLine(columnCount);
                break;

            case Alien.AlienType.AlienGrid:
                alien = new AlienGrid(gameName, Sprite.SpriteName.NullObject, index, mX, mY);
                GameObjectNodeManager.add(alien, cPCSTree);
                break;

            case Alien.AlienType.AlienExplosion:
                alien = new AlienExplode(gameName, Sprite.SpriteName.AlienExplosion, index, mX, mY);
                break;

            case Alien.AlienType.Uninitilized:
                Debug.WriteLine("Alien Type is Uninitilized");
                break;
            }

            activate(alien);
            return(alien);
        }
예제 #17
0
        public Wall createWall(Wall.WallType mWallType, GameObject.GameObjectName gameName, int index = 0, float x = 0.0f, float y = 0.0f, float width = 0.0f, float height = 0.0f)
        {
            Wall wall = null;

            switch (mWallType)
            {
            case Wall.WallType.WallTop:
                wall = new WallTop(gameName, index, Sprite.SpriteName.NullObject, x, y, width, height, Wall.WallType.WallTop);
                break;

            case Wall.WallType.WallDown:
                wall = new WallDown(gameName, index, Sprite.SpriteName.NullObject, x, y, width, height, Wall.WallType.WallDown);
                break;

            case Wall.WallType.WallLeft:
                wall = new WallLeft(gameName, index, Sprite.SpriteName.NullObject, x, y, width, height, Wall.WallType.WallLeft);
                break;

            case Wall.WallType.WallRight:
                wall = new WallRight(gameName, index, Sprite.SpriteName.NullObject, x, y, width, height, Wall.WallType.WallRight);
                break;

            case Wall.WallType.WallRoot:
                wall = new WallRoot(gameName, index, Sprite.SpriteName.NullObject, Wall.WallType.WallRoot);
                GameObjectNodeManager.add(wall, cPCSTree);
                break;

            case Wall.WallType.Uninitilized:
                Debug.WriteLine("Wall Type is Uninitilized");
                break;
            }

            this.cPCSTree.Insert(wall, this.cParent);

            wall.addSpriteToBatch(this.cSpriteBatch);
            wall.addCollisionToBatch(SpriteBatchManager.find(SpriteBatch.SpriteBatchName.Boxes));
            return(wall);
        }
예제 #18
0
        public static void remove(GameObject targetNode)
        {
            Debug.WriteLine("I am coming here for 1st time");


            GameObjectNodeManager gonManager = GameObjectNodeManager.getSingletonInstance();

            Debug.Assert(gonManager != null);
            //Find the root of the node
            GameObject safetyNode = targetNode;
            GameObject rootNode   = null;
            GameObject tempNode   = targetNode;

            while (tempNode != null)
            {
                rootNode = tempNode;
                tempNode = (GameObject)tempNode.pParent;
            }

            GameObjectNode gon = (GameObjectNode)gonManager.activeList;

            Debug.Assert(gon != null);

            // Iterate through all the active list nodes to find the root
            while (gon != null)
            {
                if (gon.getGameObject() == rootNode)
                {
                    //Found the root in the active List
                    break;
                }
                gon = (GameObjectNode)gon.pNext;
            }

            gon.removeNode(targetNode);
            gon.print();
        }
예제 #19
0
        public static void cleanup()
        {
            GameObjectNodeManager gamMInstance = GameObjectNodeManager.getSingletonInstance();

            Debug.Assert(gamMInstance != null);

            GameObjectNode gameObjNode = (GameObjectNode)gamMInstance.activeList;
            GameObject     rootNode    = gameObjNode.getGameObject();

            if (rootNode.cGameObjectName == GameObject.GameObjectName.AlienGrid)
            {
                GameObject column = (GameObject)rootNode.pChild;
                if (column.pChild == null)
                {
                    Debug.WriteLine("no aliens");
                    if (column.pSibling != null)
                    {
                        Debug.WriteLine("column has sibling");
                        column = (GameObject)column.pSibling;
                        column.pSibling.pParent = (PCSNode)rootNode;
                        column.remove();
                    }
                    else
                    {
                        // rootNode.remove(column);
                        column.pForward = null;
                        column.pReverse = null;
                        column.remove();
                        rootNode.pForward = null;
                        rootNode.pReverse = null;
                        rootNode.remove();

                        Debug.WriteLine("Done");
                    }
                }
            }
        }
예제 #20
0
        public Shield createShield(Shield.ShieldType mShieldType, GameObject.GameObjectName gameName, int index = 0, float mX = 0.0f, float mY = 0.0f)
        {
            Shield shield = null;

            switch (mShieldType)
            {
            case Shield.ShieldType.ShieldBrick:
                shield = new ShieldBrick(gameName, Sprite.SpriteName.ShieldBrick, index, mX, mY);
                break;

            case Shield.ShieldType.ShieldColumn:
                shield = new ShieldColumn(gameName, Sprite.SpriteName.NullObject, index, mX, mY);
                break;

            case Shield.ShieldType.ShieldUnit:
                shield = new ShieldUnit(gameName, Sprite.SpriteName.NullObject, index, mX, mY);
                break;

            case Shield.ShieldType.ShieldGrid:
                shield = new ShieldGrid(gameName, index, Sprite.SpriteName.NullObject);
                GameObjectNodeManager.add(shield, cPCSTree);
                break;

            case Shield.ShieldType.Uninitilized:
                Debug.WriteLine("Shield Type is Uninitilized");
                break;
            }

            this.cPCSTree.Insert(shield, this.cParent);
            // cSpriteBatch.addToBatch(shield.getProxySprite());
            // cSpriteBatch.addToBatch(shield.getCollisionObj().cSpriteBox);

            shield.addSpriteToBatch(this.cSpriteBatch);
            shield.addCollisionToBatch(SpriteBatchManager.find(SpriteBatch.SpriteBatchName.Boxes));
            return(shield);
        }
예제 #21
0
 public void load()
 {
     TextureManager.createMInstance(2, 4);
     ImageManager.createMInstance(2, 4);
     SpriteManager.createMInstance(2, 4);
     SpriteBoxManager.createMInstance(2, 4);
     SpriteBatchManager.createMInstance(2, 1);
     TimerManager.createMInstance(2, 4);
     ProxySpriteManager.createMInstance(2, 4);
     GameObjectNodeManager.createMInstance(2, 4);
     CollisionPairManager.createMInstance(2, 4);
     ShipManager.createMInstance();
     FactoryManager.createMInstance();
     InputManager.createMInstance();
     PlayerManager.createMInstance();
     GhostManager.createMInstance(1, 2);
     GlyphManager.Create(3, 1);
     FontManager.createMInstance(1, 1);
     loadTexture();
     loadImages();
     loadSprites();
     loadFont();
     loadPointSystem();
 }
 public override void notify()
 {
     Unit.spriteBoxColor = Unit.redColor;
     GameObjectNodeManager.changeColor();
 }
예제 #23
0
 public void removeFromGameManager()
 {
     GameObjectNodeManager.remove(this);
 }
예제 #24
0
        public void activateCollisions()
        {
            IrrKlang.ISoundEngine sndEngine = FactoryManager.getSoundEngine();
            CollisionPair         Bomb_Ship = CollisionPairManager.add(CollisionPair.CollisionPairName.Bomb_Ship, GameObjectNodeManager.find(GameObject.GameObjectName.BombRoot), GameObjectNodeManager.find(GameObject.GameObjectName.ShipRoot));

            Bomb_Ship.attach(new GameEndObserver());
            Bomb_Ship.attach(new ShipDeathFreezeObserver(Unit.gameFreezeTime));
            Bomb_Ship.attach(new SoundObserver(sndEngine, "Explosion.wav"));
            Bomb_Ship.attach(new BombCollideObserver());
            Bomb_Ship.attach(new BombShipCollideObserver());

            CollisionPair Alien_Missile = CollisionPairManager.add(CollisionPair.CollisionPairName.Alien_Missile, GameObjectNodeManager.find(GameObject.GameObjectName.AlienGrid), GameObjectNodeManager.find(GameObject.GameObjectName.MissileRoot));

            Alien_Missile.attach(new AlienMissileObserver());
            Alien_Missile.attach(new SoundObserver(sndEngine, "invaderkilled.wav"));
            Alien_Missile.attach(new ShipReadyObserver());

            CollisionPair Alien_Wall = CollisionPairManager.add(CollisionPair.CollisionPairName.Alien_Wall, GameObjectNodeManager.find(GameObject.GameObjectName.AlienGrid), GameObjectNodeManager.find(GameObject.GameObjectName.WallRoot));

            Alien_Wall.attach(new AlienWallObserver());
            // Alien_Wall.attach(new SoundObserver(sndEngine, "Explosion.wav"));

            CollisionPair Alien_Shield = CollisionPairManager.add(CollisionPair.CollisionPairName.Alien_Shield, GameObjectNodeManager.find(GameObject.GameObjectName.AlienGrid), GameObjectNodeManager.find(GameObject.GameObjectName.ShieldGrid));

            Alien_Shield.attach(new ShieldHitObserver());


            CollisionPair Alien_Ship = CollisionPairManager.add(CollisionPair.CollisionPairName.Alien_Ship, GameObjectNodeManager.find(GameObject.GameObjectName.AlienGrid), GameObjectNodeManager.find(GameObject.GameObjectName.ShipRoot));

            Alien_Ship.attach(new SoundObserver(sndEngine, "invaderkilled.wav"));
            Alien_Ship.attach(new GameOverObserver());
            Alien_Ship.attach(new GameEndObserver());

            CollisionPair Missile_Wall = CollisionPairManager.add(CollisionPair.CollisionPairName.Missile_Wall, GameObjectNodeManager.find(GameObject.GameObjectName.MissileRoot), GameObjectNodeManager.find(GameObject.GameObjectName.WallRoot));

            Missile_Wall.attach(new ShipReadyObserver());
            //   Missile_Wall.attach(new SoundObserver(sndEngine, "invaderkilled.wav"));
            Missile_Wall.attach(new MissileRemoveObserver());

            CollisionPair Missile_Shield = CollisionPairManager.add(CollisionPair.CollisionPairName.Missile_Shield, GameObjectNodeManager.find(GameObject.GameObjectName.MissileRoot), GameObjectNodeManager.find(GameObject.GameObjectName.ShieldGrid));

            Missile_Shield.attach(new SoundObserver(sndEngine, "invaderkilled.wav"));
            Missile_Shield.attach(new ShieldHitObserver());
            Missile_Shield.attach(new ShieldMissileObserver());
            Missile_Shield.attach(new ShipReadyObserver());

            CollisionPair Ship_Wall = CollisionPairManager.add(CollisionPair.CollisionPairName.Ship_Wall, GameObjectNodeManager.find(GameObject.GameObjectName.ShipRoot), GameObjectNodeManager.find(GameObject.GameObjectName.WallRoot));

            //   Ship_Wall.attach(new SoundObserver(sndEngine, "invaderkilled.wav"));
            Ship_Wall.attach(new ShipWallObserver());

            CollisionPair Bomb_Wall = CollisionPairManager.add(CollisionPair.CollisionPairName.Bomb_Wall, GameObjectNodeManager.find(GameObject.GameObjectName.BombRoot), GameObjectNodeManager.find(GameObject.GameObjectName.WallRoot));

            //  Bomb_Wall.attach(new SoundObserver(sndEngine, "invaderkilled.wav"));
            Bomb_Wall.attach(new BombCollideObserver());

            CollisionPair Bomb_Missile = CollisionPairManager.add(CollisionPair.CollisionPairName.Bomb_Missile, GameObjectNodeManager.find(GameObject.GameObjectName.BombRoot), GameObjectNodeManager.find(GameObject.GameObjectName.MissileRoot));

            Bomb_Missile.attach(new BombCollideObserver());
            //  Bomb_Missile.attach(new SoundObserver(sndEngine, "invaderkilled.wav"));
            Bomb_Missile.attach(new ShipReadyObserver());
            Bomb_Missile.attach(new MissileRemoveObserver());

            CollisionPair Bomb_Shield = CollisionPairManager.add(CollisionPair.CollisionPairName.Bomb_Shield, GameObjectNodeManager.find(GameObject.GameObjectName.BombRoot), GameObjectNodeManager.find(GameObject.GameObjectName.ShieldGrid));

            Bomb_Shield.attach(new BombCollideObserver());
            //   Bomb_Shield.attach(new SoundObserver(sndEngine, "invaderkilled.wav"));
            Bomb_Shield.attach(new ShieldHitObserver());

            CollisionPair Misisle_UFO = CollisionPairManager.add(CollisionPair.CollisionPairName.Misisle_UFO, GameObjectNodeManager.find(GameObject.GameObjectName.MissileRoot), GameObjectNodeManager.find(GameObject.GameObjectName.UFORoot));

            Misisle_UFO.attach(new UFOMissileObserver());
            Misisle_UFO.attach(new ShipReadyObserver());
            Misisle_UFO.attach(new SoundObserver(sndEngine, "ufo_highpitch.wav"));
            // Misisle_UFO.attach(new UFOLaunchObserver());

            CollisionPair UFO_Wall = CollisionPairManager.add(CollisionPair.CollisionPairName.UFO_Wall, GameObjectNodeManager.find(GameObject.GameObjectName.UFORoot), GameObjectNodeManager.find(GameObject.GameObjectName.WallRoot));

            UFO_Wall.attach(new UFOLaunchObserver());
        }