Newbie here, I'm creating a Flappy Bird clone using XNA and up until now I'd encountered no unsolvable problems, but I just don't know how to proceed on the spawning of pipes.
I have a pipe class, and I manage to create an instance of it based on a timer in the main game update function (I know this will create the pipe only once):
elapsedTime = (float)gameTime.ElapsedGameTime.TotalSeconds;
if (elapsedTime == 1.0f)
{
Pipe pipe = new Pipe();
}
The problem is that I can't call the pipe.Update() function in the main game update, given that "pipe" hasn't been created yet! And, in any case if I'm to spawn several instances of Pipe.cs, how do I refer to their respective Update() functions?