我的Draw
方法中有这样的声明:
public void DrawSprites(GameTime gameTime)
{
spriteBatch.Begin(SpriteSortMode.FrontToBack, BlendState.AlphaBlend);
if (shieldPowerUp == false)
// Draws the Original ship
player.Draw(gameTime, spriteBatch);
if (playerIsHit == true)
// method Draws a blinking ship for a second
PlayerIsHit(gameTime, spriteBatch);
if (shieldPowerUp == true)
// Draws a ship with a Shield for 5 seconds
playerShield.Draw(gameTime, spriteBatch);
// the rest of the method is left out
}
我现在的问题是,当绘制一艘新船时,它会在前一艘船的顶部绘制。
在绘制闪烁或屏蔽的 Ship 对象时,我不知道如何在短时间内移除原始 Ship 对象。你们对我如何进行有什么想法吗?