我试图Texture2D
通过在到达屏幕末尾时添加 x 和 y 坐标来将 s 绘制成一条线。该Draw
方法不会绘制多个精灵,它只是以 20 的速度移动第一个精灵,而不是每 20 个像素绘制一个。
protected override void Draw(GameTime gameTime)
{
GraphicsDevice.Clear(Color.White);
// TODO: Add your drawing code here
spriteBatch.Begin();
spriteBatch.DrawString(GameText, MenuText, new Vector2(325,75), Color.Red);
do
{
spriteBatch.Draw(EarthGrass, place, Color.White);
place.X += 20;
} while (place.X < 800);
place.X = -20;
place.Y += 20;
do
{
int IDBint = IDB.Next(11);
if (IDBint == 10)
{
spriteBatch.Draw(PooperMachoOre, place, Color.White);
}
else
{
spriteBatch.Draw(EarthDirt, place, Color.White);
}
place.X += 20;
} while (place.X < 800);
place.X = -20;
place.Y += 20;
spriteBatch.End();
base.Draw(gameTime);
}