public static void remove(ref MLink targetNode)
        {
            SpriteBoxManager spriteBoxMInstance = SpriteBoxManager.getSingletonInstance();

            Debug.Assert(spriteBoxMInstance != null);
            Debug.Assert(targetNode != null);
            spriteBoxMInstance.genericRemove(targetNode);
        }
Exemplo n.º 2
0
        public static SpriteBox Add(SpriteBaseName name, Azul.Rect azulRect)
        {
            SpriteBoxManager spriteBoxMan = SpriteBoxManager.GetInstance();
            SpriteBox        spriteBox    = (SpriteBox)spriteBoxMan.BaseAdd();

            spriteBox.Set(name, azulRect.x, azulRect.y, azulRect.width, azulRect.height);
            return(spriteBox);
        }
Exemplo n.º 3
0
        public static SpriteBox Find(SpriteBaseName name)
        {
            SpriteBoxManager sbMan = SpriteBoxManager.GetInstance();
            SpriteBox        sb    = (SpriteBox)sbMan.BaseFind(new SpriteBox {
                name = name
            });

            return(sb);
        }
Exemplo n.º 4
0
 public static void Create(int reserveSize = 3, int reserveIncrement = 1)
 {
     Debug.Assert(reserveSize > 0);
     Debug.Assert(reserveIncrement > 0);
     if (pInstance == null)
     {
         pInstance = new SpriteBoxManager(reserveSize, reserveIncrement);
     }
 }
Exemplo n.º 5
0
        public static void Remove(SpriteBox pNode)
        {
            SpriteBoxManager pMan = SpriteBoxManager.PrivGetInstance();

            Debug.Assert(pMan != null);

            Debug.Assert(pNode != null);
            pMan.BaseRemove(pNode);
        }
 public static void createMInstance(int deltaRefillCount = 3, int prefillCount = 5)
 {
     Debug.WriteLine("Creating Sprite Box Manager instance");
     Debug.Assert(deltaRefillCount > 0);
     Debug.Assert(prefillCount > 0);
     if (spriteBoxMInstance == null)
     {
         spriteBoxMInstance = new SpriteBoxManager(deltaRefillCount, prefillCount);
     }
 }
Exemplo n.º 7
0
        public void setSpriteBox(SpriteBox.SpriteBoxName spriteBox, SpriteBatchNodeManager mSbManager)
        {
            SpriteBox sprBox = (SpriteBox)SpriteBoxManager.find(spriteBox);

            Debug.Assert(sprBox != null);
            Debug.Assert(mSbManager != null);

            this.cSpriteBase = sprBox;
            this.cSBNodeMan  = mSbManager;
        }
Exemplo n.º 8
0
        public static void Print()
        {
            SpriteBoxManager pMan = SpriteBoxManager.PrivGetInstance();

            Debug.Assert(pMan != null);

            Debug.WriteLine("******** SPRITEBOX MANAGER *****************");
            pMan.PrintStats();
            pMan.PrintNodes();
        }
Exemplo n.º 9
0
        public static void Destroy()
        {
            SpriteBoxManager pInstance = SpriteBoxManager.PrivGetInstance();

            Debug.Assert(pInstance != null);

            pInstance.BaseDestroy();

            pInstance.pSpriteBoxCompare = null;
            SpriteBoxManager.pInstance  = null;
        }
Exemplo n.º 10
0
 //-----------------------------------------------------------------------------
 // Game::UnLoadContent()
 //       unload content (resources loaded above)
 //       unload all content that was loaded before the Engine Loop started
 //-----------------------------------------------------------------------------
 public override void UnLoadContent()
 {
     FontManager.Destroy();
     GlyphManager.Destroy();
     CollisionPairManager.Destroy();
     SpriteAnimationManager.Destroy();
     SpriteBoxManager.Destroy();
     SpriteManager.Destroy();
     ImageManager.Destroy();
     TextureManager.Destroy();
 }
Exemplo n.º 11
0
        public CollisionObject(ProxySprite proxySprite)
        {   // we'll pass in proxySprites to generate collision boxes around
            Debug.Assert(proxySprite != null);
            Sprite pSprite = proxySprite.pSprite;

            Debug.Assert(pSprite != null);
            this.pCollisionRect = new CollisionRect(pSprite.GetScreenRect());
            //Debug.WriteLine("ProxySprite Rect for {0}:({1},{2}),w:{3},h:{4}", proxySprite.pSprite.name, proxySprite.x, proxySprite.y, proxySprite.pSprite.pScreenRect.width, proxySprite.pSprite.pScreenRect.height);
            //Debug.WriteLine("CollisionRect for {0}:({1},{2}),w:{3},h:{4}", proxySprite.pSprite.name, this.pCollisionRect.x, this.pCollisionRect.y, this.pCollisionRect.width, this.pCollisionRect.height);
            this.pCollisionSpriteBox = SpriteBoxManager.Add(SpriteBaseName.Box, this.pCollisionRect);
            Debug.Assert(this.pCollisionSpriteBox != null);
            this.pCollisionSpriteBox.pLineColor = ColorFactory.Create(ColorName.Red).pAzulColor;
        }
Exemplo n.º 12
0
        public static SpriteBox Find(SpriteBox.Name name)
        {
            SpriteBoxManager pMan = SpriteBoxManager.PrivGetInstance();

            Debug.Assert(pMan != null);

            // Use compare node to compare to search nodes
            pMan.pSpriteBoxCompare.SetName(name);

            SpriteBox pData = (SpriteBox)pMan.BaseFind(pMan.pSpriteBoxCompare);

            return(pData);
        }
Exemplo n.º 13
0
        public static SpriteBox Add(SpriteBox.Name name, float x, float y, float width, float height, Azul.Color color)
        {
            SpriteBoxManager pMan = SpriteBoxManager.PrivGetInstance();

            Debug.Assert(pMan != null);

            SpriteBox pSpriteBox = (SpriteBox)pMan.BaseAdd();

            Debug.Assert(pSpriteBox != null);

            // Initialize the date
            pSpriteBox.Set(name, x, y, width, height, color);
            return(pSpriteBox);
        }
        public static SpriteBox add(SpriteBox.SpriteBoxName sbName, Azul.Rect sbRect)
        {
            SpriteBoxManager spriteBoxMInstance = SpriteBoxManager.getSingletonInstance();

            Debug.Assert(spriteBoxMInstance != null);

            SpriteBox nodeAdded = (SpriteBox)spriteBoxMInstance.genericAdd();

            Debug.Assert(nodeAdded != null);

            //set the attributes of the SpriteBox node
            nodeAdded.setAll(sbName, sbRect);

            return(nodeAdded);
        }
Exemplo n.º 15
0
        //----------------------------------------------------------------------
        // Static Methods
        //----------------------------------------------------------------------
        public static void Create(int reserveNum = 3, int reserveGrow = 1)
        {
            // make sure values are ressonable
            Debug.Assert(reserveNum > 0);
            Debug.Assert(reserveGrow > 0);

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

            // Do the initialization
            if (pInstance == null)
            {
                pInstance = new SpriteBoxManager(reserveNum, reserveGrow);
            }
        }
        public static SpriteBox find(SpriteBox.SpriteBoxName sbName)
        {
            SpriteBoxManager spriteBoxMInstance = SpriteBoxManager.getSingletonInstance();

            Debug.Assert(spriteBoxMInstance != null);

            SpriteBox pseudoSb = new SpriteBox();

            pseudoSb.cSpriteBoxName = sbName;

            Debug.Assert(spriteBoxMInstance != null);

            SpriteBox targetSb = (SpriteBox)spriteBoxMInstance.genericFind(pseudoSb);

            return(targetSb);
        }
Exemplo n.º 17
0
        // Extract the rectangle co ordinates of the sprite in the proxy sprite
        // Set those to the sprite box.

        public CollisionObject(ProxySprite mProxySprite)
        {
            Debug.Assert(mProxySprite != null);

            //Create a BoxSprite
            Sprite mSprite = mProxySprite.rcSprite;
            Debug.Assert(mSprite != null);

            cSpriteBox = SpriteBoxManager.add(SpriteBox.SpriteBoxName.Box, mSprite.screenRect);
            Debug.Assert(this.cSpriteBox != null);

            // Set the Collision Rectangle
            this.cCollisionRectangle = new CollisionRectangle(cSpriteBox.cSpriteBoxRect);
            Debug.Assert(this.cCollisionRectangle != null);
            //  this.cSpriteBox.setColor(1, 1, 1);
            // this.cSpriteBox.setColor(Unit.spriteBoxColor);
        }
Exemplo n.º 18
0
        public CollisionObject(SpriteProxy pSpriteProxy)
        {
            Debug.Assert(pSpriteProxy != null);

            // Create Collision Rect
            // Use the reference sprite to set size and shape
            Sprite pSprite = pSpriteProxy.GetSprite();

            Debug.Assert(pSprite != null);

            // Origin is in the UPPER RIGHT
            this.pCollisionRect = new CollisionRect(pSprite.GetScreenRect());
            Debug.Assert(this.pCollisionRect != null);

            // Create the sprite
            this.pCollisionSprite = SpriteBoxManager.Add(SpriteBox.Name.Box, this.pCollisionRect.x, this.pCollisionRect.y, this.pCollisionRect.width, this.pCollisionRect.height);
            Debug.Assert(this.pCollisionSprite != null);
            this.pCollisionSprite.SetLineColor(1.0f, 0.0f, 0.0f);
        }
Exemplo n.º 19
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();
 }
Exemplo n.º 20
0
        public Game()
        {   // Demo/Select Screen
            this.roundNum = 1;
            TextureManager.Create(2, 2);
            ImageManager.Create(5, 2);
            SpriteManager.Create(5, 2);
            SpriteBoxManager.Create(1, 1);
            SpriteBatchManager.Create(2, 1);
            TimerManager.Create(3, 1);
            GameObjectManager.Create(3, 1);
            ProxySpriteManager.Create(10, 5);
            CollisionPairManager.Create(2, 1);
            SoundManager.Create(9, 1);
            FontManager.Create(26, 10);
            ScoreManager.Initialize();

            //---------------------------------------------------------------------------------------------------------
            // Load Textures
            //---------------------------------------------------------------------------------------------------------
            Texture pSpritesTexture = TextureManager.Add(TextureName.Sprites, "Sprites.tga");
            Texture pShieldTexture  = TextureManager.Add(TextureName.Shields, "Shield.tga");

            TextureManager.Add(TextureName.Consolas36pt, "consolas36pt.tga");
            FontManager.AddXml("Consolas36pt.xml", FontName.Consolas36pt, TextureName.Consolas36pt);

            //---------------------------------------------------------------------------------------------------------
            // Load Sounds
            //---------------------------------------------------------------------------------------------------------
            SoundManager.Add(SoundName.explosion);
            SoundManager.Add(SoundName.fastInvader1);
            SoundManager.Add(SoundName.fastInvader2);
            SoundManager.Add(SoundName.fastInvader3);
            SoundManager.Add(SoundName.fastInvader4);
            SoundManager.Add(SoundName.invaderKilled);
            SoundManager.Add(SoundName.shoot);
            SoundManager.Add(SoundName.ufoHighPitch);
            SoundManager.Add(SoundName.ufoLowPitch);

            //---------------------------------------------------------------------------------------------------------
            // Create SpriteBatches
            //---------------------------------------------------------------------------------------------------------
            SpriteBatch sbAliens  = SpriteBatchManager.Add(SpriteBatchName.Aliens);
            SpriteBatch sbBoxes   = SpriteBatchManager.Add(SpriteBatchName.Boxes);
            SpriteBatch sbShips   = SpriteBatchManager.Add(SpriteBatchName.Ships);
            SpriteBatch sbSplats  = SpriteBatchManager.Add(SpriteBatchName.Splats);
            SpriteBatch sbShields = SpriteBatchManager.Add(SpriteBatchName.Shields);
            SpriteBatch sbFonts   = SpriteBatchManager.Add(SpriteBatchName.Fonts);

            InitializeImageManager();

            //---------------------------------------------------------------------------------------------------------
            // Create Sprites
            //---------------------------------------------------------------------------------------------------------
            SpriteManager.Add(SpriteBaseName.UFO, ImageName.UFO, 200.0f, 200.0f, 50.0f, 50.0f);
            SpriteManager.Add(SpriteBaseName.UFOBomb, ImageName.Missile, 100.0f, 700.0f, 5.0f, 32.0f);
            SpriteManager.Add(SpriteBaseName.Squid, ImageName.SquidA, 100.0f, 800.0f, 50.0f, 50.0f);
            SpriteManager.Add(SpriteBaseName.Crab, ImageName.CrabA, 100.0f, 750.0f, 50.0f, 50.0f);
            SpriteManager.Add(SpriteBaseName.Octopus, ImageName.OctopusA, 100.0f, 700.0f, 50.0f, 50.0f);
            SpriteManager.Add(SpriteBaseName.Ship, ImageName.Ship, 100.0f, 700.0f, 50.0f, 50.0f);
            SpriteManager.Add(SpriteBaseName.Missile, ImageName.Missile, 100.0f, 700.0f, 5.0f, 32.0f);
            SpriteManager.Add(SpriteBaseName.BombStraight, ImageName.BombStraightA, 100.0f, 100.0f, 10.0f, 60.0f);
            SpriteManager.Add(SpriteBaseName.BombDagger, ImageName.BombDaggerA, 100.0f, 100.0f, 20.0f, 60.0f);
            SpriteManager.Add(SpriteBaseName.BombZigZag, ImageName.BombZigZagA, 200.0f, 200.0f, 20.0f, 60.0f);
            SpriteManager.Add(SpriteBaseName.Brick, ImageName.Brick, 50.0f, 25.0f, 40.0f, 20.0f);
            SpriteManager.Add(SpriteBaseName.BrickLeftTop0, ImageName.BrickLeftTop0, 50.0f, 25.0f, 40.0f, 20.0f);
            SpriteManager.Add(SpriteBaseName.BrickLeftTop1, ImageName.BrickLeftTop1, 50.0f, 25.0f, 40.0f, 20.0f);
            SpriteManager.Add(SpriteBaseName.BrickLeftBottom, ImageName.BrickLeftBottom, 50.0f, 25.0f, 40.0f, 20.0f);
            SpriteManager.Add(SpriteBaseName.BrickRightTop0, ImageName.BrickRightTop0, 50.0f, 25.0f, 40.0f, 20.0f);
            SpriteManager.Add(SpriteBaseName.BrickRightTop1, ImageName.BrickRightTop1, 50.0f, 25.0f, 40.0f, 20.0f);
            SpriteManager.Add(SpriteBaseName.BrickRightBottom, ImageName.BrickRightBottom, 50.0f, 25.0f, 40.0f, 20.0f);
            SpriteManager.Add(SpriteBaseName.Splat, ImageName.AlienExplosion, 200.0f, 200.0f, 50.0f, 50.0f);
            SpriteManager.Add(SpriteBaseName.Explosion, ImageName.ShipExplosion, 200.0f, 200.0f, 50.0f, 50.0f);

            // Input
            InputSubject inputSubject;

            inputSubject = InputManager.GetOneSubject();
            inputSubject.RegisterObserver(new OnePlayerObserver());

            inputSubject = InputManager.GetArrowLeftSubject();
            inputSubject.RegisterObserver(new MoveLeftObserver());

            inputSubject = InputManager.GetArrowRightSubject();
            inputSubject.RegisterObserver(new MoveRightObserver());

            inputSubject = InputManager.GetSpaceSubject();
            inputSubject.RegisterObserver(new ShootObserver());
            //inputSubject = InputManager.GetTwoSubject();
            //inputSubject.RegisterObserver(new TwoPlayerObserver());

            TimerManager.Add(TimerEventName.SetGameState, TimerManager.GetCurrentTime() + 5.0f, TimerManager.GetCurrentTime() + 5.0f, new GameSelectEvent());
        }
Exemplo n.º 21
0
        //-----------------------------------------------------------------------------
        // Game::LoadContent()
        //		Allows you to load all content needed for your engine,
        //	    such as objects, graphics, etc.
        //-----------------------------------------------------------------------------
        public override void LoadContent()
        {
            // Initialize Game State Attributes
            hiScore       = 0;
            numCredits    = 0;
            twoPlayerMode = false;
            player1       = new Player(Player.Name.Player1);
            player2       = new Player(Player.Name.Player2);

            //---------------------------------------------------------------------------------------------------------
            // Manager initialization
            //---------------------------------------------------------------------------------------------------------
            TextureManager.Create(3, 1);
            ImageManager.Create(10, 2);
            SpriteManager.Create(10, 2);
            SpriteBoxManager.Create(20, 2);
            SpriteProxyManager.Create(50, 5);
            SpriteAnimationManager.Create(10, 2);
            TimerManager.Create(50, 10);
            CollisionPairManager.Create(10, 2);
            GlyphManager.Create(3, 1);
            FontManager.Create(5, 1);
            SoundEngineManager.Create();
            //---------------------------------------------------------------------------------------------------------
            // Initialize Game-Scoped Non-Singleton Managers
            //---------------------------------------------------------------------------------------------------------

            this.pGameSpriteBatchManager = new SpriteBatchManager(3, 1);

            //---------------------------------------------------------------------------------------------------------
            // Create Colors
            //---------------------------------------------------------------------------------------------------------

            pRedColor   = new Azul.Color(0.9019f, 0.0784f, 0.0784f, 1.0f);
            pGreenColor = new Azul.Color(0.1137f, 0.8196f, 0.2667f, 1.0f);

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

            TextureManager.Add(Texture.Name.Aliens, "Aliens.tga");
            TextureManager.Add(Texture.Name.Shield, "Shield.tga");
            TextureManager.Add(Texture.Name.Consolas20pt, "Consolas20pt.tga");
            TextureManager.Add(Texture.Name.Consolas36pt, "Consolas36pt.tga");

            //---------------------------------------------------------------------------------------------------------
            // Load the Fonts
            //---------------------------------------------------------------------------------------------------------

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

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

            // Aliens
            ImageManager.Add(Image.Name.OpenJellyfishAlien, Texture.Name.Aliens, 47.0f, 23.0f, 185.0f, 121.0f);
            ImageManager.Add(Image.Name.ClosedJellyfishAlien, Texture.Name.Aliens, 51.0f, 178.0f, 178.0f, 120.0f);
            ImageManager.Add(Image.Name.OpenCrabAlien, Texture.Name.Aliens, 316.0f, 24.0f, 167.0f, 119.0f);
            ImageManager.Add(Image.Name.ClosedCrabAlien, Texture.Name.Aliens, 316.0f, 179.0f, 167.0f, 119.0f);
            ImageManager.Add(Image.Name.OpenSquidAlien, Texture.Name.Aliens, 608.0f, 25.0f, 127.0f, 120.0f);
            ImageManager.Add(Image.Name.ClosedSquidAlien, Texture.Name.Aliens, 611.0f, 178.0f, 122.0f, 119.0f);
            ImageManager.Add(Image.Name.FlyingSaucer, Texture.Name.Aliens, 80.0f, 500.0f, 223.0f, 105.0f);

            // Shields
            ImageManager.Add(Image.Name.Brick, Texture.Name.Shield, 174, 110, 10, 5);
            ImageManager.Add(Image.Name.BrickLeft_Top0, Texture.Name.Shield, 153, 94, 10, 5);
            ImageManager.Add(Image.Name.BrickLeft_Top1, Texture.Name.Shield, 153, 99, 10, 5);
            ImageManager.Add(Image.Name.BrickLeft_Bottom, Texture.Name.Shield, 173, 129, 10, 5);
            ImageManager.Add(Image.Name.BrickRight_Top0, Texture.Name.Shield, 213, 94, 10, 5);
            ImageManager.Add(Image.Name.BrickRight_Top1, Texture.Name.Shield, 213, 99, 10, 5);
            ImageManager.Add(Image.Name.BrickRight_Bottom, Texture.Name.Shield, 193, 129, 10, 5);

            // Bombs
            ImageManager.Add(Image.Name.BombStraight, Texture.Name.Aliens, 378, 798, 15, 98);
            ImageManager.Add(Image.Name.BombZigZag, Texture.Name.Aliens, 574, 643, 42, 99);
            ImageManager.Add(Image.Name.BombCross, Texture.Name.Aliens, 112, 798, 42, 84);

            // Other
            ImageManager.Add(Image.Name.CoreCannon, Texture.Name.Aliens, 51.0f, 332.0f, 192.0f, 120.0f);
            ImageManager.Add(Image.Name.Missle, Texture.Name.Aliens, 419.0f, 699.0f, 16.0f, 58.0f);

            //---------------------------------------------------------------------------------------------------------
            // Create Sprites
            //---------------------------------------------------------------------------------------------------------

            // Aliens
            SpriteManager.Add(Sprite.Name.JellyfishAlien, Image.Name.OpenJellyfishAlien, 100.0f, 0.0f, 48.0f, 33.0f);
            SpriteManager.Add(Sprite.Name.CrabAlien, Image.Name.OpenCrabAlien, 100.0f, 200.0f, 45.0f, 30.0f);
            SpriteManager.Add(Sprite.Name.SquidAlien, Image.Name.OpenSquidAlien, 300.0f, 200.0f, 33.0f, 30.0f);
            SpriteManager.Add(Sprite.Name.FlyingSaucer, Image.Name.FlyingSaucer, 400.0f, 500.0f, 58.0f, 28.0f, pRedColor);

            SpriteManager.Add(Sprite.Name.GiantCrabAlien, Image.Name.OpenCrabAlien, 100.0f, 200.0f, 180.0f, 120.0f, pGreenColor);

            // Shields
            SpriteManager.Add(Sprite.Name.Brick, Image.Name.Brick, 50, 25, 12, 6);
            SpriteManager.Add(Sprite.Name.Brick_LeftTop0, Image.Name.BrickLeft_Top0, 50, 25, 12, 6);
            SpriteManager.Add(Sprite.Name.Brick_LeftTop1, Image.Name.BrickLeft_Top1, 50, 25, 12, 6);
            SpriteManager.Add(Sprite.Name.Brick_LeftBottom, Image.Name.BrickLeft_Bottom, 50, 25, 12, 6);
            SpriteManager.Add(Sprite.Name.Brick_RightTop0, Image.Name.BrickRight_Top0, 50, 25, 12, 6);
            SpriteManager.Add(Sprite.Name.Brick_RightTop1, Image.Name.BrickRight_Top1, 50, 25, 12, 6);
            SpriteManager.Add(Sprite.Name.Brick_RightBottom, Image.Name.BrickRight_Bottom, 50, 25, 12, 6);

            // Bombs
            SpriteManager.Add(Sprite.Name.BombZigZag, Image.Name.BombZigZag, 200, 200, 10, 20);
            SpriteManager.Add(Sprite.Name.BombStraight, Image.Name.BombStraight, 100, 100, 5, 20);
            SpriteManager.Add(Sprite.Name.BombCross, Image.Name.BombCross, 100, 100, 10, 20);

            // Other
            SpriteManager.Add(Sprite.Name.CoreCannon, Image.Name.CoreCannon, 400.0f, 40.0f, 50.0f, 30.0f, pGreenColor);
            SpriteManager.Add(Sprite.Name.Missile, Image.Name.Missle, 400.0f, 70.0f, 4.0f, 14.0f);

            //---------------------------------------------------------------------------------------------------------
            // Sprite Animations
            //---------------------------------------------------------------------------------------------------------

            // Squid Alien
            SpriteAnimation pSquidAnimation = SpriteAnimationManager.Add(SpriteAnimation.Name.SquidAlien, Sprite.Name.SquidAlien);

            pSquidAnimation.Attach(Image.Name.ClosedSquidAlien);
            pSquidAnimation.Attach(Image.Name.OpenSquidAlien);

            // Crab Alien
            SpriteAnimation pCrabAnimation = SpriteAnimationManager.Add(SpriteAnimation.Name.CrabAlien, Sprite.Name.CrabAlien);

            pCrabAnimation.Attach(Image.Name.ClosedCrabAlien);
            pCrabAnimation.Attach(Image.Name.OpenCrabAlien);

            // JellyFish Alien
            SpriteAnimation pJellyfishAnimation = SpriteAnimationManager.Add(SpriteAnimation.Name.JellyfishAlien, Sprite.Name.JellyfishAlien);

            pJellyfishAnimation.Attach(Image.Name.ClosedJellyfishAlien);
            pJellyfishAnimation.Attach(Image.Name.OpenJellyfishAlien);

            //---------------------------------------------------------------------------------------------------------
            // Create Game-Scoped SpriteBatches
            //---------------------------------------------------------------------------------------------------------
            pGameTexts_SpriteBatch = this.pGameSpriteBatchManager.Add(SpriteBatch.Name.GameTexts);

            FontManager.Add(Font.Name.Player1ScoreTitle, pGameTexts_SpriteBatch, "SCORE <1>", Glyph.Name.Consolas36pt, 50, 825);
            FontManager.Add(Font.Name.Player2ScoreTitle, pGameTexts_SpriteBatch, "SCORE <2>", Glyph.Name.Consolas36pt, 650, 825);
            FontManager.Add(Font.Name.HighScoreTitle, pGameTexts_SpriteBatch, "HI-SCORE", Glyph.Name.Consolas36pt, 350, 825);
            FontManager.Add(Font.Name.Player1Score, pGameTexts_SpriteBatch, GameStateManager.GetGame().GetPlayer(Player.Name.Player1).GetPoints().ToString("D4"), Glyph.Name.Consolas36pt, 80, 775);
            FontManager.Add(Font.Name.Player2Score, pGameTexts_SpriteBatch, GameStateManager.GetGame().GetPlayer(Player.Name.Player2).GetPoints().ToString("D4"), Glyph.Name.Consolas36pt, 680, 775);
            FontManager.Add(Font.Name.HighScore, pGameTexts_SpriteBatch, GameStateManager.GetGame().GetHiScore().ToString("D4"), Glyph.Name.Consolas36pt, 380, 775);

            FontManager.Add(Font.Name.GameCredits, pGameTexts_SpriteBatch, "CREDIT " + GameStateManager.GetGame().GetNumCredits(), Glyph.Name.Consolas36pt, 650, 50);

            //---------------------------------------------------------------------------------------------------------
            // Load State-specific content
            //---------------------------------------------------------------------------------------------------------

            GameStateManager.GetState(GameStateManager.GameState.Attract).LoadContent();
            GameStateManager.GetState(GameStateManager.GameState.Player1).LoadContent();
            GameStateManager.GetState(GameStateManager.GameState.Player2).LoadContent();
            GameStateManager.GetState(GameStateManager.GameState.End).LoadContent();

            // Game State -- Initialize in Attract mode
            this.pGameState = GameStateManager.GetState(GameStateManager.GameState.Attract);
            this.AttachStateInputObservers();
        }
Exemplo n.º 22
0
 public void Set(SpriteBox.Name name)
 {
     this.pSpriteBase = SpriteBoxManager.Find(name);
     Debug.Assert(this.pSpriteBase != null);
 }