Originally Posted by
Traveler
Hi Damot,
There are a few odd things in your code. First thing I noticed is the initialisation of StartDemo. There's no need to use a timer for this. Dxdraw has an event called onInitialize. If you add the StartDemo call there, you can remove the timer alltogether.
Second, I see you're using the DXSpriteEngine to draw tiles. I recommend using DirectDrawSurface instead. For an example, have a look at the third tutorial on my website. (It also includes scrolling)
Now for the important part, the reason the movement is so jerky is because your using GetTickCount not correctly (as you already guessed). In your code, 'Moveamount' will never reach a stable point. At one clock cylce it may be 2.1, the next cycle 3.4 or perhaps even 4. Adding a threshold should do the trick.
Bookmarks