Game Development Reference
In-Depth Information
Getting started: Modeling the game
The first thing to think about is the best way to share the game states among all the
players in the room, or in other words what player actions are needed to be seen by
the other player. For the tic-tac-toe game, we would need to send the player action to
the other player, meaning the client has to send up the x and y positions of where the
player placed the symbol.
The first thing to do is to create a simple XML game schema file that defines the
game state we need during game play.
There are two steps:
1. Create the XML file and save it to the root game project folder.
2.
Generate the source using the PulseCodeGen located in the bin of the
installed folder.
<ObjectSchema>
<import>
<client import="pulse.gsrc.client.*" />
</import>
<class name="Put" parent="GameState" classId="601" >
<public>
<property index="0" name="PutRow" count="1"
type="int"/>
<property index="1" name="PutColumn" count="1"
type="int"/>
<property index="2" name="PutValue" count="1"
type="int"/>
</public>
</class>
</ObjectSchema>
In the above schema file, we would like to communicate to other players their
actions. What is needed for this game is quite simple. The player chooses the spot
(row and column) and the value, meaning an X or an O , and the Put value is
determined at the start of the game depending on who actually created the game
room (the game host).
Having designed the game states that are needed for the game, we need to run the
above XML file through the PulseCodeGen tool. The following is a listing of batch
file that will do exactly that. The batch file may be saved to the project root folder.
You may need to modify the paths in the batch file as required, as your directory
structure may be different from what is presented here.
 
Search WWH ::




Custom Search