Exemplo n.º 1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="BaseGame"/> class.
        /// </summary>
        /// <param name="worldBounds">The bounds of the world (if null, {-1000, -1000} to {1000, 1000} is used)</param>
        public BaseGame(RectangleF worldBounds = null)
        {
            if (worldBounds == null)
            {
                worldBounds = new RectangleF(-1000, -1000, 2000, 2000);
            }

            this.graphicsDeviceManager = new GraphicsDeviceManager(this);
            this.gameWorld             = new World(this, worldBounds);
            this.gameCamera            = new Camera(this.gameWorld);
            this.renderSystem          = new DeferredRenderSystem(this, this.gameWorld, this.gameCamera);
            this.inputManager          = new InputManager(this);
            this.exContent             = new ExtendedContentManager(this);
            base.Content = this.exContent;

            this.inputManager.UpdateOrder = -40;
            this.gameCamera.UpdateOrder   = -30;
            this.gameWorld.UpdateOrder    = -20;
            this.renderSystem.UpdateOrder = -10;
        }
Exemplo n.º 2
0
 /// <summary>
 /// Called when graphics resources need to be loaded. Override this method to load any component-specific graphics resources.
 /// </summary>
 /// <param name="contentManager">The content manager.</param>
 public abstract void LoadContent(ExtendedContentManager contentManager);