Game Development Reference
In-Depth Information
The screenshot is that of the game screen. The circles are a visual representation of
the game states, the position of the circle comes from the corresponding game states
x and y values and so does the color from the color property. We will have two
buttons: one to add new game states and another to remove them. To add a new
circle (a game state), we click on the Add button. To remove an existing game state,
we click on any of the circles and click on the Remove button. The selected circle
appears to be raised like the one on the far right-hand side of the screenshot. We may
also modify an existing game state by moving the circles by clicking and dragging
them to a different position—doing that on one client, we can observe the change
in every other player's screen as well.
The schema file
For any Pulse-based game development, we first start out with an XML-formatted
schema file. Let's now explore the schema file for the Hello World sample.
The game developer must create a schema file that specifies all the needed game
states, avatars, and game room objects. After you have created the schema file, we
then use a Pulse modeler tool to create the class files based on the schema to be used
within the game.
So first let's examine the schema file for the Hello World project:
<ObjectSchema>
<import>
<client import="pulse.gsrc.client.*" />
</import>
<class name="HelloGameState" parent="GameState" classId="601" >
<public>
<property index="0" name="x" count="1" type="int"/>
<property index="1" name="y" count="1" type="int"/>
<property index="2" name="color" count="1" type="int"/>
</public>
</class>
</ObjectSchema>
Navigate to the project folder where you have created the project and create a file
called GameSchema.xml with the above content.
 
Search WWH ::




Custom Search