Hi All,

Please suggest me which of the below ways would be best to make a multiplayer flash game in PHP. I want all players to simultaneously see the steps made by other players.

1) Polling the server at regular intervals using AJAX.

2) Using Socket programming.

Please also suggest me if there is any other way possible using AJAX and Action Script etc.

I personally feel that socket programming would be the best way. If any of you feels the same, please suggest me how to go about this..

I would really appreciate.

Thanks....

    22 days later

    Not an easy thing to do. I have tried it. Turn-based games are possible with Flash/PHP, but trying to make a real-time game (a MMORPG, for example) would be pretty tough. The reason is that Flash has to open an HTTP request each time it talks to the server.

    Also, AJAX does not apply here because it is for XHTML/JavaScript/PHP. You're talking about Flash/PHP.

    As far as "socket programming" goes, polling with Flash/PHP is one way to go about it. Java is much more suited to what you're trying to do though, because it can maintain a connection between the server and the client.

    I don't want to tell you there's no way to do what you're describing with PHP, but you're fighting an uphill battle here.

    You may want to check out Adobe AIR, if you wanted to try this as a desktop application (which would be a little easier). AIR uses HTML, JavaScript, and PHP, so you may already know how to write the code required.

      Write a Reply...