Remove an object for a short period of time?

45 Views Asked by At

I have this statement in my Draw method:

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
}

My problem now is that when a new Ship is drawn it Draws over the top of the prevoius one.

I dont know how to remove the original ship object for a short time while the blinking or shielded Ship object is Drawn. Do you guys have any ideas for how I can proceed ?

1

There are 1 best solutions below

0
On

It solved, the problem was in my Sprites Image file, not in my code. sorry.