Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

If someone has the time I wanted to know if you would be willing to check out my solution file here:

I followed the XNA GameStateManagement on AppHub, but nothing comes up from me. and I haven't the clue why.

I believe I done everything correctly and verified it as well.

I wanted to know if someone has the time could they check it out?

Download link here:

I am racking my brain trying to figure out why it doesn't work.

Any help, is greatly appreciated.

share|improve this question
Can you be more specific about what's not working? Does it compile? If so, what's not happening that should be happening? – michael.bartnett Mar 21 '11 at 0:23
@bearcdp The window frame doesn't come up, but when I comment Components.Add(screenManager); line in the Game1.cs. It works but its the default with none of my screens. – Bombcode Mar 21 '11 at 0:46
You are going to do so much better posting the code here than a download link. – The Communist Duck Mar 21 '11 at 18:34
up vote 2 down vote accepted

You're getting stuck in an infinite loop in your ScreenManager.Update() function.

while(screensToUpdate.Count > 0)
    GameScreen screen = screensToUpdate[screensToUpdate.Count - 1];
    if(screen.ScreenState == ScreenState.TransitionOn || screen.ScreenState == ScreenState.Active)
            otherScreenHasFocus = true;

            coveredByOtherScreen = true;

You're not reducing the screensToUpdate.Count and therefore it's always greater than 0.

I forgot to mention, if you had just stepped through the code you would have quickly found the issue. Use the debugger often and set lots of breakpoints :)

Just noticed the line

GameScreen screen = screensToUpdate[screensToUpdate.Count - 1];

This will cause you issues as well as it's only ever going to update the last screen in your screensToUpdate collection.

share|improve this answer
10 minutes ago I just stepped through the code, yes I noticed my infinite loop . Thanks for taking a look at it, and I just updated and got it up and running. No screens show up, but I will debug through it. – Bombcode Mar 21 '11 at 1:25

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.