Пример #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.Black);
            flock.Draw(spriteBatch);
            // TODO: Add your drawing code here

            base.Draw(gameTime);
        }
Пример #2
0
        protected override void Draw(GameTime gameTime)
        {
            GraphicsDevice.Clear(Color.WhiteSmoke);
            base.Draw(gameTime);

            spriteBatch.Begin(samplerState: SamplerState.PointClamp);

            for (int i = 0; i < screenWidth; i += cellWidth)
            {
                spriteBatch.DrawLine(new Vector2(i, 0), new Vector2(i, screenHeight), Color.CornflowerBlue);
            }

            for (int i = 0; i < screenHeight; i += cellHeight)
            {
                spriteBatch.DrawLine(new Vector2(0, i), new Vector2(screenWidth, i), Color.CornflowerBlue);
            }

            flock.Draw(spriteBatch);

            spriteBatch.End();
        }