示例#1
0
        public SuperXbloxGame()
        {
            Content.RootDirectory = "Content";
            graphics = new GraphicsDeviceManager(this);
            graphics.PreparingDeviceSettings += new EventHandler<PreparingDeviceSettingsEventArgs>(graphics_PreparingDeviceSettings);

            mSound = new Sound(this);
            particleManager = new ParticleManager(this);
            screenManager = new ScreenManager(this);
            reticule = new Reticule(this);
            reticule2 = new Reticule(this);

            Components.Add(mSound);//0
            Components.Add(screenManager);//1
            Components.Add(particleManager);//2
            //Components.Add(reticule); //3
            //Components.Add(reticule2); //4

            //Storage.LoadSettings();
            //Components.Add(smokePlume);

            //BEGIN Xbox Live Test
            Components.Add(new GamerServicesComponent(this));//5
            //END Xbox Live TEST
        }
示例#2
0
        /// <summary>
        /// Load graphics content for the game.
        /// </summary>
        public override void LoadContent()
        {
            base.LoadContent();

            gameFont = ScreenManager.Game.Content.Load<SpriteFont>("gamefont");

            mBackground = ScreenManager.Game.Content.Load<Texture2D>("Images/Battle_Grid");
            mBackground2 = ScreenManager.Game.Content.Load<Texture2D>("Images/1");
            one = ScreenManager.Game.Content.Load<Texture2D>("Images/generic backgrounds/1");
            two = ScreenManager.Game.Content.Load<Texture2D>("Images/generic backgrounds/2");
            three = ScreenManager.Game.Content.Load<Texture2D>("Images/generic backgrounds/3");
            four = ScreenManager.Game.Content.Load<Texture2D>("Images/generic backgrounds/4");
            five = ScreenManager.Game.Content.Load<Texture2D>("Images/generic backgrounds/5");
            mBlock = ScreenManager.Game.Content.Load<Texture2D>("Images/Block_Textures/OneBlock");
            gridflip = ScreenManager.Game.Content.Load<Texture2D>("Images/flip");
            //mBlock = ScreenManager.Game.Content.Load<Texture2D>("Images/Block_Textures/OneBlock");
            //mMessageBox = ScreenManager.Game.Content.Load<Texture2D>("Images/MessageBox");
            mIntro = ScreenManager.Game.Content.Load<Texture2D>("Images/IntroScreen");
            con_front = ScreenManager.Game.Content.Load<Texture2D>("Images/ControllerImages/con_front_ortho");
            xboxlogo = ScreenManager.Game.Content.Load<Texture2D>("Images/xbox360logo1");
            con_spritefont = ScreenManager.Game.Content.Load<SpriteFont>("xboxControllerSpriteFont");
            grid_texture = ScreenManager.Game.Content.Load<Texture2D>("Images/grid");
            backbutton = ScreenManager.Game.Content.Load<Texture2D>("Images/ControllerImages/small_back");
            startbutton = ScreenManager.Game.Content.Load<Texture2D>("Images/ControllerImages/small_start");
            //bomb = ScreenManager.Game.Content.Load<Texture2D>("Images/bomb");
            grid_border = ScreenManager.Game.Content.Load<Texture2D>("Images/battle_player_border");
            reticules[0] = new Reticule(ScreenManager.Game); //(Reticule)ScreenManager.Game.Components[3];
            reticules[1] = new Reticule(ScreenManager.Game); //(Reticule)ScreenManager.Game.Components[4];
            reticules[0].LoadContent();
            reticules[1].LoadContent();
            //these will eventually be passed the current game
            Players[0] = new Player(240, 14 * 4 + 50, 24, 12, true, true, ((SuperXbloxGame)(ScreenManager.Game)).mSound, 1, PlayerIndex.One);
            Players[1] = new Player(770, 14 * 4 + 50, 24, 12, true, true, ((SuperXbloxGame)(ScreenManager.Game)).mSound, 1, PlayerIndex.Two);
            mText = ScreenManager.Game.Content.Load<SpriteFont>("navText");

            //Initialize the graphics, the game and the text objects
            Players[0].game=(SuperXbloxGame) ScreenManager.Game;
            Players[1].game = (SuperXbloxGame)ScreenManager.Game;
            Players[0].Opponent = Players[1];
            Players[1].Opponent=Players[0];

            //give the players their graphics to use
            Players[0].load(mBlock, grid_texture);
              //  Players[0].load(reticule);

            //set the target
            reticules[0].Initialize(Players[1].mPlayfield);
            reticules[1].Initialize(Players[0].mPlayfield);

            Players[1].load(mBlock, grid_texture);
              //  Players[1].load(reticule2);

            Players[1].linkedblocks = true;
            Players[1].gravity = true;
            Players[1].mPlayfield.game = Game;
            Players[1].mPlayfield.draw_collected = true;
            Players[0].linkedblocks = true;
            Players[0].gravity = true;
            Players[0].mPlayfield.game = Game;
            Players[0].mPlayfield.draw_collected = true;

            // A real game would probably have more content than this sample, so
            // it would take longer to load. We simulate that by delaying for a
            // while, giving you a chance to admire the beautiful loading screen.
            Thread.Sleep(1000);

            // once the load has finished, we use ResetElapsedTime to tell the game's
            // timing mechanism that we have just finished a very long frame, and that
            // it should not try to catch up.
            ScreenManager.Game.ResetElapsedTime();
        }