Ok I tried running the flight sim on both computers to see if the multiplayer code I wrote worked but I couldn't see both planes on screen. I could only see one plane on one computer and one on the other computer. Can anybody tell me what's wrong with the code?
-thanks
p.s. sorry if it's a little messy
//variables
////////////////////////////////////
int next=0;
int mx; //mouse position x
int my; //mouse position y
int mouseclick=0;
int joingame;
char* dogfight="dogfight";
char* player1="player1";
////////////////////////////////////
int Multiplayer(void)
{
dbLoadImage("2.jpg",117);
dbSprite(117,0,0,117);
dbSizeSprite(117,640,480);
dbLoadImage("button join game.jpg",118);
dbSprite(118,250,100,118);
next=0;
while(next==0)
{
mouseclick=dbMouseClick();
mx=dbMouseX();
my=dbMouseY();
dbSprite(110,mx,my,110);
if ( dbEscapeKey ( ) )
return(0);
joingame=dbSpriteCollision(110,118);
//join game button
if (joingame==1)
dbSetSpriteDiffuse(118,0,100,200);
else
dbSetSpriteDiffuse(118,255,255,255);
if ((joingame==1)&&(mouseclick==1))
{
if(dbNetGameNowHosting()==1)
{
dbPerformChecklistForNetSessions();
dbChecklistString(1);
dbJoinNetGame(1,player1);
}
else
{
dbPerformChecklistForNetConnections();
dbChecklistString(3);
dbSetNetConnection(3);
dbCreateNetGame(dogfight,player1,4,2);
}
return(1);
}
dbSync();
}
}