Game Development Reference
In-Depth Information
Upon running the code gen successfully, there is one AS3 class generated for each
class in the schema file and two additional supporting class files. One is a factory
class called GNetClientObjectFactory , which is responsible for creating new
instances of generated classes, and the other is GNetMetaDataMgr , which aids in
serializing and de-serializing the transmitting data over the network. The data
carried is what resides in the instances of generated classes. You don't need to deal
with these two extra classes first hand; it is mostly used by the underlying Pulse
runtime system.
As for the generated classes for what is defined in the schema file, the name
of the class would be identical to what is specified in the schema file plus the
suffix Client . In this example, there would be a class generated with the name
HelloGameStateClient.as .
Go ahead and try running the batch file called init.bat under $\samples\
HelloWorld . If you have trouble running the batch file, double-check the post
installation steps in Chapter 1.
Project directory structure
The Hello World that is part of the Pulse package is organized into the following
directory structure:
• hw
° gsrc
° client
° rsrc
° ui
The package hw being the root package contains the main class HelloWorld.as ,
and the gsrc as you see contains the generated class. The rsrc folder contains the
skin files, which we will discuss in more detail later in this chapter. The skin files in
Pulse consist of three PNG files that provide all the basic buttons and background for
the game. You can simply replace these PNG files with your own set, provided the
individual elements with the file are of the exact dimensions and are placed at the
exact same positions.
 
Search WWH ::




Custom Search