Game Development Reference
In-Depth Information
Code walk-through
Once we have generated the class files based on the schema we designed, we need
to prepare some of the game screens for the game. For this we will leverage from the
screen classes that are already available to us from the Pulse UI package. We simply
need to subclass from these classes as shown next:
TictactoeGame
This is the main class where the game code begins. This is also the place where we
tell the Pulse UI of the game specific classes that are being overridden.
Overriding the constructor
Constructor is a good place to instantiate the game-specific skinner class. More on
implementing the skinner class is discussed later. We also set the super-class defined
as s_instance to this so that any reference to the singleton points to our subclass
instead of the parent.
public function TictactoeGame() {
s_instance = this;
new TictactoeSkinner();
super();
}
Override the getGameId method from PulseGame as follows:
public override function getGameId():String {
return "Tictactoe";
}
 
Search WWH ::




Custom Search