That is because you have not written any lines of code related to moving the sprite. When you paste the image it doesn't remember the command as "250 + i", it just pastes the image at what ever location 250 + i happens to be the first time you call, in this case at position 250.
You may want to try something like this:
#include "DarkGDK.h"
void DarkGDK (void) {
int i = 0;
dbSyncOn();
dbSyncRate(60);
dbLoadImage("a.bmp", 1);
dbSprite(1, 250, 420, 1);
while (LoopGDK()) {
if (dbRightKey()) { i += 10; }
if (dbLeftKey()) { i -= 10; }
dbOffsetSprite(1, 250 + i, 420);
// You can use dbPasteSprite(1, 250 + i, 420); as well, you can read the DarkGDK documentation for more on what these functions do.
dbSync();
}
return; }
Also, you may want to consider organizing your code a bit better (although it is completely up to how you want to do organize your code), it will make it easier to follow.
One more thing, try to keep the use of dbSync(); to a minimum, calling more often than it needs to can make a game feel choppy, in my experience.
------------------------------------
Currently 900+ lines of code into an "over-the-shoulder" action RPG with combat based on rag-doll physics.