短时间内移除物体?

时间:2013-12-19 13:49:42

标签: object xna draw remove-if

我在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
}

我现在的问题是,当绘制一个新船时,它将覆盖prevoius的顶部。

在绘制闪烁或屏蔽的Ship对象时,我不知道如何在短时间内移除原始的船舶对象。你们对我如何进行有任何想法吗?

1 个答案:

答案 0 :(得分:0)

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