0

我的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 对象。你们对我如何进行有什么想法吗?

4

1 回答 1

0

它解决了,问题出在我的 Sprites Image 文件中,而不是在我的代码中。对不起。

于 2013-12-19T14:34:44.173 回答