Connecting online players [closed]

I want to create a game that connects two players. The players have to login and then proceed to the playing page.I have created the code for displaying the online players (from the activePlayer table). What I want is : the player chooses the opponent form the online players list and then the playing page displayed to both players.I …

via PHP Website Development » Search Results » ajax:

Connecting online players [closed]

I want to create a game that connects two players. The players have to login and then proceed to the playing page.
I have created the code for displaying the online players (from the activePlayer table). What I want is : the player chooses the opponent form the online players list and then the playing page displayed to both players.
I am a beginner in developing a multiplayer game.
Can anyone give me an idea of how to implement that.
……………………………………..

I believe that Felix Kling pointed you to the right direction.
Let’s say you have player A and B. Player A picks B from the online player’s list. Then player B should be notified somehow.
That can be done through AJAX. The main idea is that player B will request the server for data every n milliseconds in the background and display a notification only if player A picks him. That could be done with an extra table in the database that keeps track of the invitantions or with something like that.
Please have a look here and here as Felix has pointed out.
Edit
Again through AJAX you can alter the opponent’s image. For example if player A picks image 1 then player B will be notified in the backround and display the same image.
Good luck with your game.

For more info: Connecting online players [closed]

PHP Website Development » Search Results » ajax

Connecting online players [closed]

Share this post:

Related Posts

Leave a Comment