First time here? First time here? Newsletter Signup Newsletter
Search tutorials
Author: Prashanth Hirematada | Website: http://www.gamantra.com/pulse/

Getting Started

The first thing to think about is how best way to share the game states among all the players in the room.
Model the game
For the tic tac toe game you would need to send the player action to the other player, meaning, the client has to send up the x and y position.
The first thing to do then is to create a simple xml file that defines the game state you need during game play.
There are two steps:
1. Create the XML file.
2. Generate the source using the PulseCodeGen located in the bin of installed folder.

In the above schema file, we would like to communicate to other players of their actions, what is needed for this game is quite simple. The player choosing the spot (row and column) and the value, meaning an “X” or an “O”, the put value is determined at the start of the game depending on who actually created the game room (the game host).
After having designed game states are needed for the game, we need to run the above xml file through the PulseCodeGen tool. Following is a listing of batch file that will do exactly that.\

IF EXIST .\src\tictactoe\gsrc\client del .\src\tictactoe\gsrc\client\*.as
CALL "%GAMANTRA%"\bin\PulseCodeGen.bat .\tictactoeSchema.xml tictactoe.gsrc .\src\tictactoe\gsrc
ECHO Success!
ECHO oops!

The batch file convenient so if you changed the schema, the regeneration of source files is a quick process.

» Level Intermediate

Added: 2009-02-21
Rating: 6.04 Votes: 28
» Author
Prashanth Hirematada is the founder & Chief Architect of Gamantra, a game technology company.
» Download
Download the files used in this tutorial.
» Forums
More help? Search our boards for quick answers!
Featured Flash FLA
» Author: Inocreato
» Title: RaiseTheBlocks
» Description: Raise all the blocks to win the game
Featured Sound Loops
Image for equalize

Audio Player

» Author: TomCat Carty
» Title: The Wood
» Description: Just a little game ending or it can maybe be looped. Recorders with music box and percussion to give the feel of well, I don't know, the woods? Free to use, just credit me. thank you
Latest Font
» Author: Fábio FAFERS
» Description: I created this font for free use. Everyone can apply it in personal or business texts. Its free, but I want to be communicated in case of business use. Donations are accepted to keep the project of free fonts alive! Thank you all
Featured Sound Fx
Image for equalize

Audio Player

» Author: Davisigner
» Description: Hmm... what to say about this one? It's reminiscent of the closing notes of the opening music from the Three Stooges done in a church organ style with a closing cymbal crash. I'll give this one away gratis, but feel free to check out my free loops and potential upcoming license-mandated ones over in the respective part of Flashkit.