Jump to content
  • Advertisement
Sign in to follow this  
chadsxe

XNA - Screen will not update unless I click the edge of it with mouse (somtimes)

This topic is 3254 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, Very odd problem I am having and I can not for the life of me figure out what the issue is. I am drawing to the screen via the spriteBatch. In my main loop there is a time based conditional statement that once is entered updates a few sprites and draws them at there new position. My issue is that this does not work proper all the time. When it does not work I have to actually click the title bar of the window and let go before the screen updates. Other times it works with no problems. Stepping through the debugger it appears to also work without problems. I am at a loss for words.... Anyone know what might cause this issue? Regards Chad

Share this post


Link to post
Share on other sites
Advertisement
Sounds like a timing issue. When you grab the window with the mouse or use the debugger, the elapsed time between frames is much larger.

Post the code that updates the sprites.

Share this post


Link to post
Share on other sites
This is the section in question
            if (collision.WallCollision(Direction.DOWN, focusBlock, arena))
{
delayDrop += gameTime.ElapsedRealTime.TotalSeconds;
}
if (delayDrop >= 1)
{
// reset counter
delayDrop = 0;
// Update sprites
HandleDroppedBlock();
}







Edit: I think it might have to do with ElapsedRealTime. I am going to try and change it to ElapsedGameTime.

Share this post


Link to post
Share on other sites
Quote:
Original post by Gage64
Try this instead:

delayDrop += gameTime.ElapsedGameTime.TotalSeconds;


Yeah I just caught that. I tried it and so far it appears to be working.

Thanks

Chad

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!