me and my friends have decided to build a 2d game we got an idea and all of that so i started to build it and stacked in some spots which i just don't know what to do in addition o never did something like that before so it may be very easy so i thought of asking in the forums,here is my program(btw i never was on a any forum before so i don't know how to enter a code and all of that so it will be nice if you explain to me how you do this to)
(#include "DarkGDK.h"
#include <string.h>
void DarkGDK ( void )
{
dbSyncOn ( );
dbSyncRate ( 60 );
dbSyncOn ( );
dbSyncRate ( 60 );
dbLoadImage ( "reka.png", 1 );
dbSprite ( 1, 0, 0, 1 );
dbLoadImage ( "igul.png", 2 );
dbSprite ( 1, 0, 0, 2 );
int x=0;
int y=0;
int ever=1;
int a[4];
dbShowMouse();
dbClearEntryBuffer();
while ( LoopGDK ( ) )
{
for(int j=1;j<10;j++)
{
for(int i=1;i<4;i++)
{
if(dbScanCode()==72)
{
a[i]=8;
while(dbKeyState (72)==1)
dbSleep(0);
}
else
if(dbScanCode()==80)
{
a[i]=2;
while(dbKeyState (80)==1)
dbSleep(0);
}
else
if(dbScanCode()==77)
{
a[i]=6;
while(dbKeyState (77)==1)
dbSleep(0);
}
else
if(dbScanCode()==75)
{
a[i]=4;
while(dbKeyState (75)==1)
dbSleep(0);
}
}
for(int i=1;i<4;i++)
{
if(a[i]==8)
dbText ( 150, 150+i*10, "8");
if(a[i]==6)
dbText ( 150, 150+i*10, "6");
if(a[i]==4)
dbText ( 150, 150+i*10, "4");
if(a[i]==2)
dbText ( 150, 150+i*10, "2");
}
}
dbSync ( );
}
return;
})
this program is a test program for my real game but it doesn't worked,the plan was that the user had to press 3 keys and a circle then moved 3 times with a delay of 1 sec each time but it didn't worked so i did this program to check what is wrong and i saw that only a[1] is changes and if i press all buttons fast and together this also changes the other and its not suppose to be like that so help me with that please,another my question can you use the dbScanCode command in the void GDK and not in the loop? need a answer please,another question how i can use all dark basic functions in the program such as line and ink because it says that undeclared variables,and last question when i try to build the program(any program)it writes:"error PRJ0003 : Error spawning 'cmd.exe'." o succeed 1 failed and it doesn't work so help me in this too sorry if i have too many questions but i just don't know what to do...il be great full if you will solve at least one of my problems thanks.