Q:

XNA 4 - Timer not Spawning Asteroids

I'm trying to spawn my asteroid after a certain amount of time.  I do this by making a timer. 
Here's the update method. 
public void Update(GameTime theTime)
        {
            gameTime = theTime;
            vPlayer. Y += velocity. Y;

            float secs = (float)theTime. ElapsedGameTime. Seconds;
            timeElapsed += secs;
            secs = 1.5f;

            if (timeElapsed == spawnAsteroid)
            {
                DrawAdsteroid();
                timeElapsed = 0f;
            }

            if (Keyboard. GetState().IsKeyDown(Keys. Down))
            {
                velocity. Y = 5;
            }

            else if (Keyboard. GetState().IsKeyDown(Keys. Up))
            {
                velocity. Y = -5;
            }

            else
            {
                velocity. Y = 0;
            }

            if (vPlayer. Y > 630 )//+ Game1.tPlayer. Height)
                vPlayer. Y = 630;
            if (vPlayer. Y < -10) //+ Game1.tPlayer. Height)
                vPlayer. Y = -10;
        }

Here's the DrawAsteroid method
public void DrawAdsteroid()
        {
            spriteBatch. Begin();
            spriteBatch. Draw(Game1.tAsteroid, vAsteroid, Color. White);
            spriteBatch. End();
        }

And here is the variables being defined. 
SpriteBatch spriteBatch;
        GameTime gameTime;

        Vector2 vPlayer = new Vector2(0, 720 / 2);
        Vector2 vAsteroid;
        Vector2 velocity;
        Random rand = new Random();

        float timeElapsed = 0f;
        float spawnAsteroid = 1.5f;

The problem that happens is that the asteroids never appear.  I believe my timer is not working because I debugged and the if statement wouldn't execute. 

A:

You have to draw in the Draw method
Remove this from your update method:
    if (timeElapsed == spawnAsteroid)
    {
        DrawAdsteroid();
        timeElapsed = 0f;
    }

Before we add it to your draw method, we must first make a change, timeElapsed may NEVER equal spawnAsteroid exactly, and even if it did, each frame we refresh the screen so It would only be draw for one frame.  Because of this we must use the greater than or equal operator >=
-EDIT-
But I realize that you need more than one asteroid, so lets use a List to store all the asteroids.  You should create your own asteroid class, but for this example we will just use a list of positions:
List<Vector2> Asteroids = new List<Vector2>();

Try doing this in your Draw method:
protected override void Draw(GameTime gameTime)
{
GraphicsDevice. Clear(Color. Black) //Add a background and clear screen each frame
foreach (Vector2 asteroid in Asteroids) //Draw each astroid
{
     DrawAsteroid(asteroid. X,asteroid. Y);
}

}

Also, as an extra I recommend you apply elapsed time to the velocity, this way on different computers or times when your performance is different, it will move at exactly the same speed.  You can do this by doing:
 float elapsed = (float)gameTime. ElapsedGameTime. TotalSeconds;
 if (Keyboard. GetState().IsKeyDown(Keys. Down))
 {
                velocity. Y = SPEED * elapsed;
 }

In your update method we will need to make some new code to spawn asteroids
Make these new variables:
float spawnTimer;
float spawnRate = 1; //Spawn every second

And add this code to update (Remove the old spawning code)
float elapsed = (float)gameTime. ElapsedGameTime. TotalSeconds;
spawnTimer += elapsed;
if (spawnTimer >= spawnRate)
{
Asteroids. Add(new Vector2(X,Y));
spawnTimer = 0;
}

