示例#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)
        {
            graphics.GraphicsDevice.Clear(Color.Black);

            lineBatch.Begin();

            aiEngine.Draw();

            Vector3 vShift = new Vector3(0, 0, 5);

            for (int w = 0; w < aiEngine.World.Maps[0].Width; w++)
            {
                for (int h = 0; h < aiEngine.World.Maps[0].Height; h++)
                {
                    if (aiEngine.World.Maps[0].Node(w, h).Type == 0)
                    {
                        lineBatch.DrawLine(
                            aiEngine.World.Maps[0].Node(w, h).Position,
                            aiEngine.World.Maps[0].Node(w, h).Position + vShift,
                            Color.Red);
                    }
                }
            }

            lineBatch.End();

            base.Draw(gameTime);
        }