Skip to main content
13 events
when toggle format what by license comment
Jan 25, 2016 at 20:32 vote accept Shyy Guy
Jan 25, 2016 at 19:32 comment added ClassicThunder "The correct way to structure pretty much any game is to have a strict separation between drawing and updating code. Both share the same state information, but their responsibilities are very different: Update reads inputs, modifies the game state, and never touches the graphics device. Draw reads but does not modifiy the game state, and has no access to inputs" Also credited to Shawn Hargreaves.
Jan 25, 2016 at 18:42 answer added Felsir timeline score: 1
Jan 25, 2016 at 5:56 comment added Shyy Guy I've always been somewhat confused by this. Could you define what logic code is with some code examples? Besides draw code, the majority is if-else code and for loops...
Jan 25, 2016 at 5:46 comment added ClassicThunder blogs.msdn.com/b/shawnhar/archive/2007/07/25/…
Jan 25, 2016 at 5:46 comment added ClassicThunder It sounds like you are putting logic code in the Draw function instead of the Update function. The update function gets called a set number of times (as dictated by the TargetElapsedTime) even if that requires dropping Draw calls.
Jan 25, 2016 at 4:49 comment added Shyy Guy Thanks @DMGregory, that fixed the additional note issue. Unfortunately, the speed issue is still present when it is not a fixed time step.
Jan 25, 2016 at 4:06 comment added DMGregory The TimeSpan.FromSeconds(16.666) line looks like you're mixing seconds & milliseconds - should that not be either TimeSpan.FromMilliseconds(16.666) or TimeSpan.FromSeconds(0.016666) ?
Jan 25, 2016 at 3:45 history edited Shyy Guy CC BY-SA 3.0
minor edit to reduce confusion
Jan 25, 2016 at 3:40 history edited Shyy Guy CC BY-SA 3.0
added some additional code
Jan 25, 2016 at 3:34 answer added Nils Ole Timm timeline score: 0
Jan 25, 2016 at 3:20 review First posts
Jan 25, 2016 at 4:39
Jan 25, 2016 at 3:20 history asked Shyy Guy CC BY-SA 3.0