예제 #1
0
        public override void Notify()
        {
            this.pSoundEngine = SoundEngineMan.Find(SoundEngine.Name.Invaderkilled);
            Debug.Assert(pSoundEngine != null);

            this.pSoundEngine.PlaySound();
        }
        public override void Notify()
        {
            this.pSoundEngine = SoundEngineMan.Find(SoundEngine.Name.Explosion);
            Debug.Assert(pSoundEngine != null);

            this.pSoundEngine.PlaySound();
        }
        public static void Dump()
        {
            SoundEngineMan pMan = SoundEngineMan.privGetInstance();

            Debug.Assert(pMan != null);

            pMan.baseDump();
        }
        public static void Remove(SoundEngine pNode)
        {
            SoundEngineMan pMan = SoundEngineMan.privGetInstance();

            Debug.Assert(pMan != null);

            Debug.Assert(pNode != null);
            pMan.baseRemove(pNode);
        }
예제 #5
0
        public void SetActive(bool state)
        {
            this.enable = state;

            SoundEngine pSoundEngine = SoundEngineMan.Find(SoundEngine.Name.Shoot);

            Debug.Assert(pSoundEngine != null);

            pSoundEngine.PlaySound();
        }
        public static SoundEngine Find(SoundEngine.Name name)
        {
            SoundEngineMan pMan = SoundEngineMan.privGetInstance();

            Debug.Assert(pMan != null);

            pMan.poNodeCompare.name = name;

            SoundEngine pData = (SoundEngine)pMan.baseFind(pMan.poNodeCompare);

            return(pData);
        }
        public static SoundEngine Add(SoundEngine.Name name, string pSoundName, float soundVolume)
        {
            SoundEngineMan pMan = SoundEngineMan.privGetInstance();

            Debug.Assert(pMan != null);

            SoundEngine pNode = (SoundEngine)pMan.baseAdd();

            Debug.Assert(pNode != null);

            // Check the data initialization
            Debug.Assert(pSoundName != null);

            pNode.Set(name, pSoundName, soundVolume);
            return(pNode);
        }
        public void Attach(SoundEngine.Name soundName)
        {
            // Get the Sound
            SoundEngine pSound = SoundEngineMan.Find(soundName);

            Debug.Assert(pSound != null);

            // Create a new holder
            SoundHolder pSoundHolder = new SoundHolder(pSound);

            Debug.Assert(pSoundHolder != null);

            // Attach it to the Animation Sprite ( Push to front )
            DLink.AddToEnd(ref this.poFirstSound, pSoundHolder);

            // Set the first one to this Sound
            this.pCurrSound = pSoundHolder;
        }
        //----------------------------------------------------------------------
        // Static Methods
        //----------------------------------------------------------------------
        public static void Create(int reserveNum = 1, int reserveGrow = 1)
        {
            Debug.Assert(reserveNum > 0);
            Debug.Assert(reserveGrow > 0);

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

            // Do the initialization
            if (pInstance == null)
            {
                pInstance = new SoundEngineMan(reserveNum, reserveGrow);
            }

            // NullObject SoundEngine
            SoundEngine pSoundEngine = SoundEngineMan.Add(SoundEngine.Name.NullObject, "invaderkilled.wav", 0.0f);

            Debug.Assert(pSoundEngine != null);
        }
예제 #10
0
        override public void Execute(float deltaTime)
        {
            // Get random Bomb pos
            if (this.pGameObj.name == GameObject.Name.AlienGrid)
            {
                this.pGrid      = (AlienGrid)this.pGameObj;
                this.pAlienBomb = this.pGrid.GetRandomAlienBombPos();
            }
            else if (this.pGameObj.name == GameObject.Name.UFO)
            {
                this.pUFO       = (UFO)this.pGameObj;
                this.pAlienBomb = this.pUFO.GetGameObject();
            }

            if (pGameObj.onScreen == true)
            {
                // Create Bomb
                this.SetRandomBomb();

                Debug.Assert(this.pBomb != null);
                pBomb.ActivateCollisionSprite(this.pSB_Boxes);
                pBomb.ActivateGameSprite(this.pSB_Aliens);

                // Attach the missile to the Bomb root
                GameObject pBombRoot = GameObjectMan.Find(GameObject.Name.BombRoot);
                Debug.Assert(pBombRoot != null);

                // Add to GameObject Tree - {update and collisions}
                pBombRoot.Add(pBomb);


                SoundEngine pSoundEngine = SoundEngineMan.Find(SoundEngine.Name.Shoot);
                Debug.Assert(pSoundEngine != null);

                pSoundEngine.PlaySound();

                // Add timer event
                TimerMan.Add(TimeEvent.Name.BombRandom, this, time);
            }
        }
예제 #11
0
        //-----------------------------------------------------------------------------
        // Game::LoadContent()
        //		Allows you to load all content needed for your engine,
        //	    such as objects, graphics, etc.
        //-----------------------------------------------------------------------------
        public override void LoadContent()
        {
            //---------------------------------------------------------------------------------------------------------
            // Setup Managers
            //---------------------------------------------------------------------------------------------------------

            TextureMan.Create(1, 1);
            ImageMan.Create(5, 2);
            //GameSpriteMan.Create(4, 2);
            BoxSpriteMan.Create(3, 1);
            //TimerMan.Create(3, 1);
            ProxySpriteMan.Create(10, 1);
            //GameObjectMan.Create(3, 1);
            ColPairMan.Create(1, 1);
            GlyphMan.Create(3, 1);
            FontMan.Create(1, 1);
            SoundEngineMan.Create(3, 1);

            // Player Unique Systems
            SpriteBatchMan.Create();
            GameSpriteMan.Create();
            GameObjectMan.Create();
            TimerMan.Create();
            DelayedObjectMan.Create();

            //---------------------------------------------------------------------------------------------------------
            // Load the Textures
            //---------------------------------------------------------------------------------------------------------

            TextureMan.Add(Texture.Name.Aliens, "Invaders_0.tga");
            TextureMan.Add(Texture.Name.Shield, "Birds_N_shield.tga");

            //---------------------------------------------------------------------------------------------------------
            // Create Images
            //---------------------------------------------------------------------------------------------------------

            // ----- Aliens -----
            ImageMan.Add(Image.Name.SquidOpen, Texture.Name.Aliens, 616, 28, 112, 112);
            ImageMan.Add(Image.Name.SquidClosed, Texture.Name.Aliens, 616, 182, 112, 112);
            ImageMan.Add(Image.Name.CrabOpen, Texture.Name.Aliens, 321, 28, 155, 112);
            ImageMan.Add(Image.Name.CrabClosed, Texture.Name.Aliens, 321, 182, 155, 112);
            ImageMan.Add(Image.Name.OctopusOpen, Texture.Name.Aliens, 56, 28, 167, 112);
            ImageMan.Add(Image.Name.OctopusClosed, Texture.Name.Aliens, 56, 182, 167, 112);

            // ----- UFO -----
            ImageMan.Add(Image.Name.UFO, Texture.Name.Aliens, 83, 503, 225, 98);

            // ----- Missile -----
            ImageMan.Add(Image.Name.Missile, Texture.Name.Aliens, 420, 700, 15, 55);

            // ----- Ship -----
            ImageMan.Add(Image.Name.Ship, Texture.Name.Aliens, 56, 336, 182, 112);

            // ----- Splats -----
            ImageMan.Add(Image.Name.AlienSplat, Texture.Name.Aliens, 574, 490, 182, 112);
            ImageMan.Add(Image.Name.MissleSplat, Texture.Name.Aliens, 405, 490, 112, 112);
            ImageMan.Add(Image.Name.BombSplat, Texture.Name.Aliens, 699, 798, 84, 112);
            ImageMan.Add(Image.Name.UFOSplat, Texture.Name.Aliens, 41, 643, 294, 112);
            ImageMan.Add(Image.Name.ShipSplat, Texture.Name.Aliens, 307, 335, 210, 112);

            // ----- Bombs -----
            ImageMan.Add(Image.Name.BombDragger, Texture.Name.Aliens, 280, 798, 42, 84);
            ImageMan.Add(Image.Name.BombZigZag, Texture.Name.Aliens, 574, 644, 42, 98);
            ImageMan.Add(Image.Name.BombRolling, Texture.Name.Aliens, 447, 797, 42, 98);
            ImageMan.Add(Image.Name.BombStraight, Texture.Name.Aliens, 377, 798, 14, 98);

            // ----- Shields -----
            ImageMan.Add(Image.Name.Brick, Texture.Name.Shield, 20, 210, 10, 5);
            ImageMan.Add(Image.Name.BrickLeft_Top0, Texture.Name.Shield, 15, 180, 10, 5);
            ImageMan.Add(Image.Name.BrickLeft_Top1, Texture.Name.Shield, 15, 185, 10, 5);
            ImageMan.Add(Image.Name.BrickLeft_Bottom, Texture.Name.Shield, 35, 215, 10, 5);
            ImageMan.Add(Image.Name.BrickRight_Top0, Texture.Name.Shield, 75, 180, 10, 5);
            ImageMan.Add(Image.Name.BrickRight_Top1, Texture.Name.Shield, 75, 185, 10, 5);
            ImageMan.Add(Image.Name.BrickRight_Bottom, Texture.Name.Shield, 55, 215, 10, 5);

            //---------------------------------------------------------------------------------------------------------
            // Create Scenes
            //---------------------------------------------------------------------------------------------------------
            pSceneContext = SceneContext.GetInstance();
        }
예제 #12
0
        public override void Initialize()
        {
            //this.name = SceneContext.Scene.Play;

            this.numLives = 3;
            this.isDead   = false;

            //---------------------------------------------------------------------------------------------------------
            // Unique Managers
            //---------------------------------------------------------------------------------------------------------

            this.poSpriteBatchMan = new SpriteBatchMan(3, 1);
            SpriteBatchMan.SetActive(this.poSpriteBatchMan);

            this.poGameObjectMan = new GameObjectMan(3, 1);
            GameObjectMan.SetActive(this.poGameObjectMan);

            this.poTimerMan = new TimerMan(3, 1);
            TimerMan.SetActive(this.poTimerMan);

            this.poDelayedObjectMan = new DelayedObjectMan();
            DelayedObjectMan.SetActive(this.poDelayedObjectMan);

            //---------------------------------------------------------------------------------------------------------
            // Initialize Input Keys
            //---------------------------------------------------------------------------------------------------------

            this.poInputMan = new InputMan();
            InputMan.SetActive(this.poInputMan);

            InputSubject pInputSubject;

            pInputSubject = InputMan.GetArrowRightSubject();
            pInputSubject.Attach(new MoveRightObserver());

            pInputSubject = InputMan.GetArrowLeftSubject();
            pInputSubject.Attach(new MoveLeftObserver());

            pInputSubject = InputMan.GetSpaceSubject();
            pInputSubject.Attach(new ShootObserver());

            pInputSubject = InputMan.GetKey_B_Subject();
            pInputSubject.Attach(new Key_B_Observer());

            pInputSubject = InputMan.GetKey_1_Subject();
            pInputSubject.Attach(new Key_1_Observer());

            pInputSubject = InputMan.GetKey_2_Subject();
            pInputSubject.Attach(new Key_2_Observer());

            pInputSubject = InputMan.GetKey_Q_Subject();
            pInputSubject.Attach(new Key_Q_Observer());

            //---------------------------------------------------------------------------------------------------------
            // Sound
            //---------------------------------------------------------------------------------------------------------

            // start up the engine
            SoundEngineMan.Add(SoundEngine.Name.AlienA, "fastinvader1.wav", 0.2f);
            SoundEngineMan.Add(SoundEngine.Name.AlienB, "fastinvader2.wav", 0.2f);
            SoundEngineMan.Add(SoundEngine.Name.AlienC, "fastinvader3.wav", 0.2f);
            SoundEngineMan.Add(SoundEngine.Name.AlienD, "fastinvader4.wav", 0.2f);
            SoundEngineMan.Add(SoundEngine.Name.Shoot, "shoot.wav", 0.2f);
            SoundEngineMan.Add(SoundEngine.Name.Invaderkilled, "invaderkilled.wav", 0.2f);
            SoundEngineMan.Add(SoundEngine.Name.Explosion, "explosion.wav", 0.2f);
            SoundEngineMan.Add(SoundEngine.Name.UFO_HighPitch, "ufo_highpitch.wav", 0.5f);
            SoundEngineMan.Add(SoundEngine.Name.UFO_LowPitch, "ufo_lowpitch.wav", 0.2f);

            //---------------------------------------------------------------------------------------------------------
            // Font
            //---------------------------------------------------------------------------------------------------------

            Texture pTexture = TextureMan.Add(Texture.Name.Consolas36pt, "Consolas36pt.tga");

            GlyphMan.AddXml(Glyph.Name.Consolas36pt, "Consolas36pt.xml", Texture.Name.Consolas36pt);

            //---------------------------------------------------------------------------------------------------------
            // Create Sprites
            //---------------------------------------------------------------------------------------------------------
            this.poGameSpriteMan = new GameSpriteMan(3, 1);
            GameSpriteMan.SetActive(this.poGameSpriteMan);

            // ----- Aliens -----
            GameSpriteMan.Add(GameSprite.Name.SquidOpen, Image.Name.SquidOpen, 50, 550, 22, 22);
            GameSpriteMan.Add(GameSprite.Name.CrabOpen, Image.Name.CrabOpen, 50, 510, 25, 25);
            GameSpriteMan.Add(GameSprite.Name.OctopusOpen, Image.Name.OctopusOpen, 50, 430, 28, 28);

            // ----- UFO -----
            GameSpriteMan.Add(GameSprite.Name.UFO, Image.Name.UFO, 0, 500, 40, 18);

            // ----- Missile -----
            GameSpriteMan.Add(GameSprite.Name.Missile, Image.Name.Missile, 50, 430, 4, 15);

            // ----- Ship -----
            GameSpriteMan.Add(GameSprite.Name.Ship, Image.Name.Ship, 50, 430, 50, 25);

            // ----- Splats -----
            GameSpriteMan.Add(GameSprite.Name.SplatAlien, Image.Name.AlienSplat, 100, 100, 22, 22);
            GameSpriteMan.Add(GameSprite.Name.SplatBomb, Image.Name.BombSplat, 100, 100, 7, 17);
            GameSpriteMan.Add(GameSprite.Name.SplatMissile, Image.Name.MissleSplat, 100, 100, 20, 15);
            GameSpriteMan.Add(GameSprite.Name.SplatUFO, Image.Name.UFOSplat, 100, 100, 40, 18);
            GameSpriteMan.Add(GameSprite.Name.SplatShip, Image.Name.ShipSplat, 100, 100, 50, 25);

            // ----- Bombs -----
            GameSpriteMan.Add(GameSprite.Name.BombDragger, Image.Name.BombDragger, 100, 100, 7, 17);
            GameSpriteMan.Add(GameSprite.Name.BombZigZag, Image.Name.BombZigZag, 100, 100, 7, 17);
            GameSpriteMan.Add(GameSprite.Name.BombRolling, Image.Name.BombRolling, 100, 100, 7, 17);
            GameSpriteMan.Add(GameSprite.Name.BombStraight, Image.Name.BombStraight, 100, 100, 5, 17);

            // ----- Shields -----
            float brick_W = 15.0f;
            float brick_H = 6.0f;

            GameSpriteMan.Add(GameSprite.Name.Brick, Image.Name.Brick, 50, 25, brick_W, brick_H);
            GameSpriteMan.Add(GameSprite.Name.Brick_LeftTop0, Image.Name.BrickLeft_Top0, 50, 25, brick_W, brick_H);
            GameSpriteMan.Add(GameSprite.Name.Brick_LeftTop1, Image.Name.BrickLeft_Top1, 50, 25, brick_W, brick_H);
            GameSpriteMan.Add(GameSprite.Name.Brick_LeftBottom, Image.Name.BrickLeft_Bottom, 50, 25, brick_W, brick_H);
            GameSpriteMan.Add(GameSprite.Name.Brick_RightTop0, Image.Name.BrickRight_Top0, 50, 25, brick_W, brick_H);
            GameSpriteMan.Add(GameSprite.Name.Brick_RightTop1, Image.Name.BrickRight_Top1, 50, 25, brick_W, brick_H);
            GameSpriteMan.Add(GameSprite.Name.Brick_RightBottom, Image.Name.BrickRight_Bottom, 50, 25, brick_W, brick_H);

            //---------------------------------------------------------------------------------------------------------
            // Create SpriteBatch
            //---------------------------------------------------------------------------------------------------------

            SpriteBatch pSB_Aliens  = this.poSpriteBatchMan.Add(SpriteBatch.Name.Aliens, 100);
            SpriteBatch pSB_Shields = this.poSpriteBatchMan.Add(SpriteBatch.Name.Shields, 200);
            SpriteBatch pSB_Texts   = this.poSpriteBatchMan.Add(SpriteBatch.Name.Texts, 300);
            SpriteBatch pSB_Box     = this.poSpriteBatchMan.Add(SpriteBatch.Name.Boxes, 400);

            //---------------------------------------------------------------------------------------------------------
            // Create Aliens
            //---------------------------------------------------------------------------------------------------------

            // Create the Aliens factory
            AlienFactory AF = new AlienFactory(SpriteBatch.Name.Aliens, SpriteBatch.Name.Boxes);

            // Initialize Grid
            AlienGrid pGrid = (AlienGrid)AF.Create(GameObject.Name.AlienGrid, AlienCategory.Type.Grid);

            // Generate Aliens
            pGrid.GenerateAlien(this.poGameObjectMan);

            MoveCommand pMoveGrid = new MoveCommand(pGrid);

            TimerMan.Add(TimeEvent.Name.MoveGrid, pMoveGrid, 0.5f);

            //---------------------------------------------------------------------------------------------------------
            // Timer
            //---------------------------------------------------------------------------------------------------------

            // Create animation for Squid sprite
            AnimationSprite pAnimSquid = new AnimationSprite(GameSprite.Name.SquidOpen);

            // Attach Squid images to cycle
            pAnimSquid.Attach(Image.Name.SquidOpen);
            pAnimSquid.Attach(Image.Name.SquidClosed);


            // Create animation for Crab sprite
            AnimationSprite pAnimCrab = new AnimationSprite(GameSprite.Name.CrabOpen);

            // Attach Crab images to cycle
            pAnimCrab.Attach(Image.Name.CrabOpen);
            pAnimCrab.Attach(Image.Name.CrabClosed);


            // Create animation for Octopus sprite
            AnimationSprite pAnimOctopus = new AnimationSprite(GameSprite.Name.OctopusOpen);

            // Attach Octopus images to cycle
            pAnimOctopus.Attach(Image.Name.OctopusOpen);
            pAnimOctopus.Attach(Image.Name.OctopusClosed);


            // Add AnimationSprite to timer
            TimerMan.Add(TimeEvent.Name.SwapAliens, pAnimSquid, 0.5f);
            TimerMan.Add(TimeEvent.Name.SwapAliens, pAnimCrab, 0.5f);
            TimerMan.Add(TimeEvent.Name.SwapAliens, pAnimOctopus, 0.5f);

            // Add Grid Tempo
            GridSoundTempoEvent pGridTempo = new GridSoundTempoEvent();

            pGridTempo.Attach(SoundEngine.Name.AlienA);
            pGridTempo.Attach(SoundEngine.Name.AlienB);
            pGridTempo.Attach(SoundEngine.Name.AlienC);
            pGridTempo.Attach(SoundEngine.Name.AlienD);

            TimerMan.Add(TimeEvent.Name.GridSoundTempo, pGridTempo, 0.5f);

            //---------------------------------------------------------------------------------------------------------
            // Create Missile
            //---------------------------------------------------------------------------------------------------------

            // Missile Root
            MissileGroup pMissileGroup = new MissileGroup(GameObject.Name.MissileGroup, GameSprite.Name.NullObject, 0.0f, 0.0f);

            pMissileGroup.ActivateGameSprite(pSB_Aliens);
            pMissileGroup.ActivateCollisionSprite(pSB_Box);

            GameObjectMan.Attach(pMissileGroup);

            //---------------------------------------------------------------------------------------------------------
            // Splat Root
            //---------------------------------------------------------------------------------------------------------
            BombRoot pSplatRoot = new BombRoot(GameObject.Name.SplatRoot, GameSprite.Name.NullObject, 0.0f, 0.0f);

            pSplatRoot.ActivateCollisionSprite(pSB_Box);

            GameObjectMan.Attach(pSplatRoot);

            //---------------------------------------------------------------------------------------------------------
            // Bomb Root
            //---------------------------------------------------------------------------------------------------------
            BombRoot pBombRoot = new BombRoot(GameObject.Name.BombRoot, GameSprite.Name.NullObject, 0.0f, 0.0f);

            pBombRoot.ActivateCollisionSprite(pSB_Box);

            GameObjectMan.Attach(pBombRoot);
            TimerMan.Add(TimeEvent.Name.BombRandom, new BombSpawnEvent(pRandom, pGrid), 1.0f);

            //---------------------------------------------------------------------------------------------------------
            // Create Walls
            //---------------------------------------------------------------------------------------------------------

            // Wall Root
            WallGroup pWallGroup = new WallGroup(GameObject.Name.WallGroup, GameSprite.Name.NullObject, 0.0f, 0.0f);

            pWallGroup.ActivateGameSprite(pSB_Aliens);
            pWallGroup.ActivateCollisionSprite(pSB_Box);

            WallRight pWallRight = new WallRight(GameObject.Name.WallRight, GameSprite.Name.NullObject, 775, 290, 20, 500);

            pWallRight.ActivateCollisionSprite(pSB_Box);

            WallLeft pWallLeft = new WallLeft(GameObject.Name.WallLeft, GameSprite.Name.NullObject, 25, 290, 20, 500);

            pWallLeft.ActivateCollisionSprite(pSB_Box);

            // Add to the composite the children
            pWallGroup.Add(pWallRight);
            pWallGroup.Add(pWallLeft);

            GameObjectMan.Attach(pWallGroup);

            //---------------------------------------------------------------------------------------------------------
            // Create No Score Items
            //---------------------------------------------------------------------------------------------------------

            WallGroup pNoScoreGroup = new WallGroup(GameObject.Name.NoScoreGroup, GameSprite.Name.NullObject, 0.0f, 0.0f);

            pNoScoreGroup.ActivateGameSprite(pSB_Aliens);
            pNoScoreGroup.ActivateCollisionSprite(pSB_Box);

            WallTop pWallTop = new WallTop(GameObject.Name.WallTop, GameSprite.Name.NullObject, 400, 540, 700, 0);

            pWallTop.ActivateCollisionSprite(pSB_Aliens);

            WallBottom pWallBottom = new WallBottom(GameObject.Name.WallBottom, GameSprite.Name.NullObject, 400, 40, 730, 0);

            pWallBottom.ActivateGameSprite(pSB_Aliens);
            pWallBottom.ActivateCollisionSprite(pSB_Box);

            pNoScoreGroup.Add(pWallTop);
            pNoScoreGroup.Add(pWallBottom);

            GameObjectMan.Attach(pNoScoreGroup);

            //---------------------------------------------------------------------------------------------------------
            // Ship
            //---------------------------------------------------------------------------------------------------------

            ShipRoot pShipRoot = new ShipRoot(GameObject.Name.ShipRoot, GameSprite.Name.NullObject, 0.0f, 0.0f);

            pShipRoot.ActivateGameSprite(pSB_Aliens);
            pShipRoot.ActivateCollisionSprite(pSB_Box);

            GameObjectMan.Attach(pShipRoot);

            //ShipMan.Create();

            this.poShipMan = new ShipMan();
            ShipMan.SetActive(this.poShipMan);
            this.poShipMan.pShip = ShipMan.ActivateShip();
            this.poShipMan.pShip.SetState(ShipMan.State.Ready);


            //---------------------------------------------------------------------------------------------------------
            // UFO
            //---------------------------------------------------------------------------------------------------------
            UFORoot pUFORoot = new UFORoot(GameObject.Name.UFORoot, GameSprite.Name.NullObject, 0.0f, 0.0f);

            pUFORoot.ActivateGameSprite(pSB_Aliens);
            pUFORoot.ActivateCollisionSprite(pSB_Box);

            GameObjectMan.Attach(pUFORoot);
            TimerMan.Add(TimeEvent.Name.UFORandom, new UFOSpawnEvent(pRandom), 5.0f);

            //---------------------------------------------------------------------------------------------------------
            // Shields
            //---------------------------------------------------------------------------------------------------------

            Composite pShieldRoot = ShieldsGroupFactory.Create(100, 130, this.poGameObjectMan);

            //---------------------------------------------------------------------------------------------------------
            // ColPair
            //---------------------------------------------------------------------------------------------------------

            // Grid vs Right Left Walls
            ColPair pColPair_GW = ColPairMan.Add(ColPair.Name.Alien_Wall, pGrid, pWallGroup);

            Debug.Assert(pColPair_GW != null);

            pColPair_GW.Attach(new GridDropObserver());

            // Ship vs Right Left Walls
            ColPair pColPair_SW = ColPairMan.Add(ColPair.Name.Ship_Wall, pShipRoot, pWallGroup);

            Debug.Assert(pColPair_SW != null);

            pColPair_SW.Attach(new StopShipMoveObserver());

            // Grid vs Shield
            ColPair pColPair_AS = ColPairMan.Add(ColPair.Name.Bomb_Shield, pGrid, pShieldRoot);

            Debug.Assert(pColPair_AS != null);

            pColPair_AS.Attach(new RemoveBrickObserver());

            // Missile vs Alien
            ColPair pColPair_MA = ColPairMan.Add(ColPair.Name.Missile_Alien, pMissileGroup, pGrid);

            Debug.Assert(pColPair_MA != null);

            pColPair_MA.Attach(new ShipReadyObserver());
            pColPair_MA.Attach(new RemoveAlienObserver(this));
            pColPair_MA.Attach(new ShipRemoveMissileObserver(false));
            pColPair_MA.Attach(new SndAlienHitObserver());
            pColPair_MA.Attach(new SpeedGridObserver());

            // Missile vs UFO
            ColPair pColPair_MU = ColPairMan.Add(ColPair.Name.Missile_UFO, pMissileGroup, pUFORoot);

            Debug.Assert(pColPair_MU != null);

            pColPair_MU.Attach(new ShipReadyObserver());
            pColPair_MU.Attach(new ShipRemoveMissileObserver(false));
            pColPair_MU.Attach(new RemoveUFOObserver());
            pColPair_MU.Attach(new SndAlienHitObserver());

            // Missle vs Bomb
            ColPair pColPair_MB = ColPairMan.Add(ColPair.Name.Missile_Bomb, pMissileGroup, pBombRoot);

            Debug.Assert(pColPair_MB != null);

            pColPair_MB.Attach(new ShipReadyObserver());
            pColPair_MB.Attach(new ShipRemoveMissileObserver(false));
            pColPair_MB.Attach(new BombObserver(true));

            // Missile vs Top Wall
            ColPair pColPair_MW = ColPairMan.Add(ColPair.Name.Missile_Wall, pMissileGroup, pNoScoreGroup);

            Debug.Assert(pColPair_MW != null);

            pColPair_MW.Attach(new ShipReadyObserver());
            pColPair_MW.Attach(new ShipRemoveMissileObserver(true));

            // Missile vs Shield
            ColPair pColPair_MS = ColPairMan.Add(ColPair.Name.Misslie_Shield, pMissileGroup, pShieldRoot);

            Debug.Assert(pColPair_MS != null);

            pColPair_MS.Attach(new ShipRemoveMissileObserver(false));
            pColPair_MS.Attach(new RemoveBrickObserver());
            pColPair_MS.Attach(new ShipReadyObserver());
            pColPair_MS.Attach(new SndAlienHitObserver());

            // Bomb vs Bottom Wall
            ColPair pColPair_BW = ColPairMan.Add(ColPair.Name.Bomb_Wall, pBombRoot, pNoScoreGroup);

            Debug.Assert(pColPair_BW != null);

            pColPair_BW.Attach(new BombObserver(true));

            // Bomb vs Shield
            ColPair pColPair_BS = ColPairMan.Add(ColPair.Name.Bomb_Shield, pBombRoot, pShieldRoot);

            Debug.Assert(pColPair_BS != null);

            pColPair_BS.Attach(new RemoveBombObserver(this));
            pColPair_BS.Attach(new RemoveBrickObserver());
            pColPair_BS.Attach(new SndAlienHitObserver());

            // Bomb vs Player's Ship
            ColPair pColPair_BP = ColPairMan.Add(ColPair.Name.Bomb_Ship, pBombRoot, pShipRoot);

            Debug.Assert(pColPair_BP != null);

            pColPair_BP.Attach(new RemoveShipObserver(this));
            pColPair_BP.Attach(new RemoveBombObserver(this));
            pColPair_BP.Attach(new SndShipHitObserver());
            pColPair_BP.Attach(new ReCreateShipObserver(this));

            //---------------------------------------------------------------------------------------------------------
            // Fonts
            //---------------------------------------------------------------------------------------------------------

            FontMan.Add(Font.Name.ScoreText, SpriteBatch.Name.Texts, "SCORE<1>", Glyph.Name.Consolas36pt, 60, 585);
            pFontScore1 = FontMan.Add(Font.Name.Score1, SpriteBatch.Name.Texts, "0000", Glyph.Name.Consolas36pt, 85, 558);

            FontMan.Add(Font.Name.ScoreText, SpriteBatch.Name.Texts, "HI-SCORE", Glyph.Name.Consolas36pt, 325, 585);
            pFontHighScore = FontMan.Add(Font.Name.HighScore, SpriteBatch.Name.Texts, "0000", Glyph.Name.Consolas36pt, 350, 558);

            FontMan.Add(Font.Name.ScoreText, SpriteBatch.Name.Texts, "SCORE<2>", Glyph.Name.Consolas36pt, 600, 585);
            pFontScore2 = FontMan.Add(Font.Name.Score2, SpriteBatch.Name.Texts, "0000", Glyph.Name.Consolas36pt, 625, 558);

            FontMan.Add(Font.Name.ScoreText, SpriteBatch.Name.Texts, "LIVES: ", Glyph.Name.Consolas36pt, 50, 25);
            pFontLives = FontMan.Add(Font.Name.Lives, SpriteBatch.Name.Texts, "3", Glyph.Name.Consolas36pt, 160, 25);
        }