When launching a game multiple times in a console, the first time this.Exit()
on the game class is called, all following games do not properly run. Instead they exit 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?
Game
; what are you trying to accomplish? Can you do it with multiple processes instead? \$\endgroup\$