Exemplo n.º 1
0
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);

            Util.UI.Elements.Button.ButtonFont     = ContentManager.Load <SpriteFont>("Arial");
            Util.UI.Elements.TextView.TextViewFont = ContentManager.Load <SpriteFont>("ArialSmall");

            PrimitiveDrawer       = new Primitive(Graphics.GraphicsDevice, spriteBatch);
            PrimitiveDrawer.Depth = 1.0f;

            Hud = new Hud();

            Camera.LoadContent();
            Hud.LoadContent();

            MovingEntityRenderer.LoadContent();
            GameRenderer.LoadContent();

            Player.Init();
            Player.ConnectToWorld();

            LivingEntityType.Create(new WorldPosition(WorldGrid.BlockSize.X * 3, WorldGrid.BlockSize.Y * 3, Interior.Outside), LivingEntityType.lookup[3]).ConnectToWorld();

            AppDomain.CurrentDomain.ProcessExit += new EventHandler((object sender, EventArgs e) =>
            {
                SaveAndExit();
            });
        }
Exemplo n.º 2
0
        public static void Draw(SpriteBatch spriteBatch, GameTime gameTime, SimulationGame simulationGame)
        {
            simulationGame.GraphicsDevice.Clear(Color.Black);

            spriteBatch.Begin(SimulationGame.Camera, SpriteSortMode.FrontToBack);

            WorldRenderer.Draw(spriteBatch, gameTime);

            if (SimulationGame.IsGodMode)
            {
                MovingEntityRenderer.Draw(spriteBatch, gameTime, SimulationGame.Player);
            }

            spriteBatch.End();

            LightningRenderer.Draw(spriteBatch, gameTime);

            // Hud
            spriteBatch.Begin();

            SimulationGame.Hud.Draw(spriteBatch, gameTime);

            spriteBatch.End();
        }