Hello everybody,
I'm trying to make a multiplayer tetris. I wan't to synchronize the two games on each computer with each other. Now I'm stuck with the following problem:
On a certain moment in the game the client has to wait until a variable is set. The variable is send by the server. Now i'm wondering how the program can "wait" until the variable is set. I tried it like I would do it in C but my program crashed that way. I fully understand signals and slots but I think i can't use it in this case.
else
{
while(!ack_piece) // <---- I need a way to fix this
{
}
this->set_ack_piece(false);
qDebug()<<"beginstadium van nextpiece = "<<nextpiece_temp;
nextPiece.setRandomShape(nextpiece_temp);
}
else
{
while(!ack_piece) // <---- I need a way to fix this
{
}
this->set_ack_piece(false);
qDebug()<<"beginstadium van nextpiece = "<<nextpiece_temp;
nextPiece.setRandomShape(nextpiece_temp);
}
To copy to clipboard, switch view to plain text mode
Hope somebody can help me.
Thanks
Bookmarks