I've been making a pong game and i have a problem. At first i used basic 2d to create the table and it was fine. then when i put i sprite on the screen and run it, the screen starts to flicker. I don't know if you can't use basic 2d and sprites together or you have to do something else.
void DarkGDK(void)
{
dbSyncOn();
dbSyncRate(60);
dbDisableEscapeKey();
dbSetImageColorKey(255,0,255);
// colors
int red = dbRGB(255,0,0);
int black = dbRGB(0,0,0);
int green = dbRGB(0,255,0);
// score numbers
int ply = 0;
int comp = 5;
char player[2] = "";
char computer[2] = "";
// images
dbLoadImage("paddle.png",1);
dbSprite(1,0,dbScreenHeight()/2,1);
while(LoopGDK())
{
dbSync();
dbSetWindowTitle("Pong");
dbMaximizeWindow();
// set up the board
itoa(ply, player, 10);
itoa(comp, computer, 10);
dbSetTextSize(30);
dbText(dbScreenWidth()/2-25,0,player);
dbText(dbScreenWidth()/2+8,0,computer);
dbInk(red,black);
dbLine(dbScreenWidth()/2,0,dbScreenWidth()/2,dbScreenHeight());
// set up the player/computer
}
}
Thanks