Game Development Reference
In-Depth Information
Modeling the avatar
If the game you are developing requires the avatar or player to carry more
information than already defined in the GameAvatar object, you need to specify a
class in the schema file with a parent set to GameAvatar. Note that there should only
be one such subclass defined.
Property
Notes
Score
Use this to keep track of the score within the game. The score is reset
to zero when a player enters a room.
isHost
A Boolean property that is true if the avatar is the game room host.
exp
The total experience for the avatar is stored in this property.
cash
This property may be used to store remaining virtual cash the
avatar has.
level
The overall level of the avatar on the game portal or of a game if
only game is being hosted.
ready
When inside a game room, this property is true if the player is in
ready status.
pos
The position of the player around the table inside of the game room.
Starting from 0 for the game host and increasing by one for every
player entering the room.
The developer may inherit from GameAvatar and specify an arbitrary number of
properties. Note that the total number of bytes should not exceed 1K bytes. The reason
for this limitation is that data objects are managed on the server in chunks of 1K
bytes. Although this puts a limitation on the game developer, it is done to maximize
efficiency and should be enough for any casual game that you want to implement.
Avatar display in Hello World
The default behavior of PulseUI shows avatars in a few places. Upon successfully
logging in, the first screen that is rendered is the lobby interface; the avatar of the
player is shown in the top right-hand corner of the screen. It is also shown in the
same place inside the game screen. The avatar is also displayed in the friend list
panel, where it shows friends of the player and during the game play where other
players in the game room are.
Following is the screenshot of the lobby screen:
Search WWH ::




Custom Search