Im not sure if this is the correct place for this, because this is more of a design question.
I am making my first multi-player game, one that uses two computers and the internet, not two people at one computer type of multi-player game.
So, I assume everyone knows how to play tic-tac-toe (if not: http://en.wikipedia.org/wiki/Tic-Tac-Toe
). So my question is what would be a good way to randomly assign one player X and the other one O?
I am not sure if anyone knows how a php flash communication server works, so I'll explain it:
- First a user connects
- The server sends flash the privacy file allowing it to connect
- Flash then reconnects to the server after a successful connection
- Flash waits until the server sends something to it
- The server receives information then sends it to everyone else that is connected
Doing this you could potentially have chat server, game server, etc.
I don't want to have to modify the php to handle the X's and O's I would like that to be done via flash, so the flash would have to check if anyone is playing if some one is playing, then check what player the other player is (X or O) and assign him/her the opposite of that.
If there is no one playing, then randomly assign the current player X or O.
Anyone know how I could tackle this?