Hot answers tagged

18

You're moving the circle by one pixel per frame. It should not come as a big surprise that, if your rendering loop runs at 30 FPS, your circle will move 30 at pixels per second. You basically have three possible ways to deal with this issue: Just pick one frame rate and stick to it. That's what a lot of old-school games did — they'd run at a fixed ...


8

Your code is currently running each time a frame renders. If the frame rate is higher or lower than your specified frame rate, your results would change as the updates don't have the same timing. To solve this, you should refer to Delta Timing. The purpose of Delta Timing is to eliminate the effects of lag on computers that try to handle complex ...


5

That's because you limit your frame rate, but you only do one update per frame. So let's assume the game runs at the target 60 fps, you get 60 logic updates per second. If the frame rate drops to 15 fps, you'd only have 15 logic updates per second. Instead, try accumulating the frame time passed so far and then update your game logic once for every given ...


1

This technique is called MRT'S or Multiple Render Targets, and employs the use of additional Framebuffers. Why is this used? Because when wanting to achieve certain screen space effects, whether it is screen space lighting or ambient occlusion, it is quite efficient to store certain scene parameters as textures. Imagine a scene with hundreds of lights ...


1

How do I know which buffer to draw to? You don't. Direct3D will automatically manage this for you and correctly rotate the back buffers at Present time.


1

Yeah, it's not necessary. When you detect a collision between A & B you should do something like: if (detectCollision(A, B)) { A.resolveCollision(B); B.resolveCollision(A); } This may not be how you do it, but you get the idea! If it is a problem that A has had it's values changed after resolving collision with B you could store the variables ...



Only top voted, non community-wiki answers of a minimum length are eligible