/// <summary>
        /// Initializes a new instance of the BallerburgGame class
        /// </summary>
        public BallerburgGame()
        {
            Instance = this;
              gameSettings = new GameSettings();
              playerSettings = new PlayerSettings[4];

              applicationSettings = new ApplicationSettings();

              graphics = new GraphicsDeviceManager(this)
                     {
                       PreferredBackBufferWidth = 640,
                       PreferredBackBufferHeight = 480
                     };

              graphicsManager = new BallerburgGraphicsManager();
              contentManager = new ContentManager();
              shaderManager = new ShaderManager();
              audioManager = new AudioManager(applicationSettings, contentManager);
              gameObjectManager = new GameObjectManager(contentManager, this.audioManager, this.graphicsManager);

              MousePointer = new MousePointer(this)
                         {
                           DrawOrder = 1000,
                           RestrictZone = new Rectangle(0, 0, 640, 480)
                         };
              Components.Add(MousePointer);

              // Create the screen manager component.
              screenManager = new ScreenManager(graphicsManager, contentManager, gameObjectManager, applicationSettings, gameSettings, shaderManager, audioManager, playerSettings)
                          {
                            GameMousePointer = MousePointer
                          };
        }
Esempio n. 2
0
        public AudioGame()
        {
            // Creates a graphics manager. This is mandatory.
            graphicsDeviceManager = new GraphicsDeviceManager(this);

            // Create the pointer manager
            pointerManager = new PointerManager(this);
            pointerState = new PointerState();

            IsMouseVisible = true;

            random = new Random();

            audioManager = new AudioManager(this);
            audioManager.EnableMasterVolumeLimiter();
            //EnableSpatialAudioWithReverb();

            // Setup the relative directory to the executable directory
            // for loading contents with the ContentManager
            Content.RootDirectory = "Content";

        }
Esempio n. 3
0
        public GameCore()
        {
            Content.RootDirectory = "Content";

              graphics = new GraphicsDeviceManager( this );

              PlayerWins = new Dictionary<uint, int>( 4 );
              PlayerColors = new Color[4]
              {
            new Color( 10,  100, 220 ),
            new Color( 200,  31,   7 ),
            new Color( 240, 180,   0 ),
            new Color( 80,  200,  10 ),
              };

              graphics.PreferredDepthStencilFormat = DepthFormat.Depth24Stencil8;

              IsFixedTimeStep = false;
              graphics.SynchronizeWithVerticalRetrace = true;

              AudioManager = new AudioManager( this );
              Components.Add( AudioManager );

              // Create the screen manager component.
              screenManager = new ScreenManager( this );

              Components.Add( screenManager );

              HighscoreComponent highscoreComponent = new HighscoreComponent( this, null, "Avatar Hamster Panic" );
              HighscoreComponent.Global = highscoreComponent;
              Components.Add( highscoreComponent );

              // Activate the first screens.
              //screenManager.AddScreen( new BackgroundScreen(), null );
              //screenManager.AddScreen( new MainMenuScreen(), null );

              DisplayGamertags = true;
              ShareHighScores = true;
              SoundEffectsVolume = 1f;
              MusicVolume = 1f;

              // Avatars require GamerServices
              Components.Add( new GamerServicesComponent( this ) );

              Rumble = new RumbleComponent( this );
              Components.Add( Rumble );

              Instance = this;

              // Debugging components
              DebugManager = new DebugManager( this );
              DebugManager.DrawOrder = 200;
              Components.Add( DebugManager );
              DebugCommand = new DebugCommandUI( this );
              DebugCommand.DrawOrder = 200;
              Components.Add( DebugCommand );
              FpsCounter = new FpsCounter( this );
              FpsCounter.DrawOrder = 200;
              Components.Add( FpsCounter );
              TimeRuler = new TimeRuler( this );
              TimeRuler.DrawOrder = 200;
              Components.Add( TimeRuler );
        }