#include "DarkGDK.h"
void DarkGDK ( void ){
dbSyncOn ( );
dbSyncRate ( 60 );
dbDisableEscapeKey ( );
dbRandomize ( dbTimer ( ) );
dbSetImageColorKey ( 255, 0, 255 );
int i,j,p,xbg1,ybg1,xbg2,ybg2,xbg3,ybg3;
char c;
dbLoadImage("bgarcade2.bmp",1);
dbLoadImage("bgversus2.bmp",2);
dbLoadImage("bghighscore2.bmp",3);
dbLoadImage("bgoption2.bmp",4);
dbLoadImage("bgexit2.bmp",5);
xbg1=0;
ybg1=0;
xbg2=-1000;
ybg2=-1000;
xbg3=-1000;
ybg3=-1000;
p=1;
while ( LoopGDK ( ) ){
if ( dbEscapeKey ( ) ){
break;
}
if (dbDownKey()){
p=p+1;
if (p==2){
xbg2=0;
ybg2=0;
xbg1=-1000;
ybg1=-1000;
}
else if (p==3){
xbg3=0;
ybg3=0;
xbg2=-1000;
ybg2=-1000;
}
}
dbStretchSprite(1,63,63);
dbSprite(1,xbg1,ybg1,1);
dbStretchSprite(2,63,63);
dbSprite(2,xbg2,ybg2,2);
dbStretchSprite(3,63,63);
dbSprite(3,xbg3,ybg3,3);
dbSync ( );
}
return;
}
why my dbDownKey so weird???
I have a pict with 3 menus, my position now at menu 1, I want to go to menu 2 when I press DownKey, but, when I press DownKey, my position now at menu 3.. why??? I think the DownKey look like looping forever...Please help me..T_T.. and whad solution for input from user?? keystate?? or what?? thx