I made this one:
#include "DarkGDK.h"
#include <stdio.h>
void DarkGDK ( void )
{
dbSyncOn ( );
dbSyncRate ( 60 );
FILE *f;
f = fopen("world.dat","r");
char svet[1000];
dbLoadImage("ground.png",1);
dbLoadImage("sky.png",2);
int dlzka = 0;
for(int i=0;i<15;i++){
fscanf(f,"%s",svet);
for(int k=0;svet[k]!='\n';k++,dlzka++){
if(svet[k]=='0') dbSprite(i*dlzka+k+100,k*32,i*32,2);
if(svet[k]=='d') dbSprite(i*dlzka+k+100,k*32,i*32,1);
}
}
dbSetImageColorKey ( 255, 0, 255 );// Set the transparency color of the sprites, in this case, it will be bright pink
*/
// our main loop
while ( LoopGDK ( ) )
{
if(dbRightKey()){
for(int i=0;i<=dlzka*15-200;i++)
dbSprite(i+100,dbSpriteX(i+100)-1,dbSpriteY(i+100),dbSpriteImage(i+100));
}
// update the screen
dbSync ( );
}
// return back to windows
return;
}
The world.dat file include this one:
000000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000000000000000000
d00000dd0000000000000000000000000000000000000000000000000000000000000000000
dd0000dd0000d00000000000000000000000000000000000000000000000000000000000000
ddd000dd000ddd0000000000000000000000000000000000000000000000000000000000000
ddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd
ddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd
The problem is that if I press RightKey it takes too much time to move all of the sprites one pixel to left. Than I have to move the screen to right, but I can't find a function for it. Does some exist? Or how to do this scrolling in fast time? I have no idea
Pls help me!