- take the occurrence of one player's turn (which happens on the Flash movie on one player's browser),
- send the critical information (which player and their new position on the grid) to the database on the server,
- and update the display of that player on all of the other players' Flash movies.
In addition, the thread mentions that you can attach a callback function which will handle the event of the completion of the request--i.e. once the data has been loaded from the requested URL, that function is called and you can access the returned data. So in the PHP I'll check on the success of the database insertion and send that result back (which I believe is just via 'echo' in PHP... wow I'm rusty on PHP).
I intended to draw a higher-level diagram of how this would all work, but I ended up writing in what is almost entirely correct code (as opposed to pseudocode or less). I have some explanatory side notes written in, and arrows to show the overall informational flow.
*Important note* I realized that this plan encompasses only the communication between one instance of the Flash game (on one client browser) and the database. It does not cover the implementation of updating multiple players' instances of the same game on different clients, but it is the first step towards that.
Anyway here's the diagram. (As usual, click to see in full size.) I have a propensity for hand-drawing/writing stuff these days, it seems.
No comments:
Post a Comment