When launching a game multiple times in a console, the first time this.Exit()this.Exit()
on the game class is called, all following games do not properly run. Instead they existexit immediately.
For example, if I have a function that does:
foreach(var i in options) {
using(var game = new MyGame()) {
game.Run();
}
}
and the game class has
protected override void Update(GameTime gameTime)
{
if(gameTime.TotalGameTime.TotalSeconds > 3)
this.Exit();
base.Update(gameTime);
}
then the first instance will execute just fine (for 3 seconds), but the second will exit immediately.
How can I prevent XNA from making the second games die immediately.
P.S. This has nothing to do with the gameTime variable, I've checked that in the second situation the this.Exit is never even called.?