I did some very simple web games with AJAX (tic tac toe, connect four), for single player.
Now I want to migrate to multiplayer, so I need to establish some kind of client-server connections.
In my games I press "start game" and it shows "waiting for another player to join", but then I dont know how to approach the situation.
Can you please give me a hint? I did some client server applications in the past, but for web it's for sure different, I just need to know how to approach.
I saw some solutions used in chat's but I would like to know your opinions. I dont need to save any data in a persistent way, I just want people access my game webpage and have one of two options:
- start game if nobody is with the page open
- join game if already is someone waiting
- and so on...
From what I saw (and want) I need to create a system similar to chats where users goes to a "room" after clicking start game button (being already logged in) and waits for another user.
hummm should I create gameRoom class? How do I create rooms and assign users to it?
Thanks in advance.