예제 #1
0
        /// <summary>
        /// This is called when the game should draw itself.
        /// </summary>
        /// <param name="gameTime">Provides a snapshot of timing values.</param>
        protected override void Draw(GameTime gameTime)
        {
            GraphicsDevice.Clear(Color.CornflowerBlue);

            shipManager.Draw();

            DebugShapeRenderer.Draw(gameTime, ModedCamera.View, ModedCamera.Projection);

            base.Draw(gameTime);
        }
예제 #2
0
        /// <summary>
        /// Allows the game to perform any initialization it needs to before starting to run.
        /// This is where it can query for any required services and load any non-graphic
        /// related content.  Calling base.Initialize will enumerate through any components
        /// and initialize them as well.
        /// </summary>
        protected override void Initialize()
        {
            //camera = new Camera(new Vector3(0, 0, 500), graphics);
            random = new Random();
            ModedCamera.Initialize(graphics.GraphicsDevice);
            DebugShapeRenderer.Initialize(GraphicsDevice);
            MessageBus.Initialize();
            shipManager = new ShipManager(random, Content);
            shipManager.Initialize();
            consoleWriter         = new ConsoleWriter();
            retrieveInitialMemory = true;
            lastMemMeasure        = 0;
            mem = 0;

            base.Initialize();
        }
예제 #3
0
        public void Draw()
        {
            if (alive)
            {
                foreach (ModelMesh mesh in model.Meshes)
                {
                    foreach (BasicEffect effect in mesh.Effects)
                    {
                        effect.LightingEnabled = true;
                        effect.EnableDefaultLighting();
                        effect.World      = world;
                        effect.View       = ModedCamera.View;
                        effect.Projection = ModedCamera.Projection;
                    }

                    mesh.Draw();
                }
                DebugShapeRenderer.AddBoundingSphere(boundingSphere, Color.Green);
            }
        }