Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Multiplayer Game, XML, PHP, MYSQL, etc

Status
Not open for further replies.

PmtAce

Technical User
Apr 6, 2006
17
US
>>>I am trying to start making multiplayer games. I have a few ideas of how to make a multiplayer game for flash, but I am having troubles with almost all of them. If you have a better way of how to do it, please tell me.
>>>My first way is to load variable from xml into flash. I would then display all the information, like where the players are, etc. I would have the person be able to do something. I would then send the variables to a php document that would record the info into a xml document. I am having major complications with all of it.
>>>Another way I thought would work was to connect to a Mysql database. However, I found there was no way to do so.
>>>Could someone tell me how to do this one of the ways, or if there is a better way to do this.
 
you have the right idea

have flash send variables to be stored to a php file which will send them to a mysql backend

when a player logs in you can grab the info from mysql and have php either send the variables straight to flash or have php send them to flash as xml
 
Thx for the reply. I get it now, but I have heard of an even faster way of doing it. XML Socket connection. I understand how it works completely, except how it recieves/sends data. I understand to use xmlObject.send("string"), but how do I send multiple things at once and be able to pick it apart. For example, in a game I might want to send a players x and y cordinates. Do I save the string as <left>value</left><top>value</top>, then send it, and when I load it I say
XMLSocket.onData = function(msg)
{
player1._x = msg.childNode[0].nodeValue;
player1._y = msg.childNode[1].nodeValue;
}
Thanks for the other response, and could you please help me with this way 2.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top