Game Development Reference
In-Depth Information
Frog is used to communicate each frog's initial position, 0 being the
bottommost. All frogs start at spot zero. This game state is added as a normal
game state. Property frog is the color of the frog. At the start of the game,
the host adds one game state for each frog. This is how the frog positions
are synchronized across all clients.
HandCard game state represents one of the cards. This game state is added by
a player in order to acquire a card in hand. Note that this game state is used
(added) as a unique game state.
PlayerAction is a game state that is broadcast when the player plays or
discards a card. This is used as a game state action in the game.
Gameplay implementation
In this last section, we will see how the game states we defined are put into action to
implement the game.
The following are the properties of the game screen (Game) class:
private var m_mgr:CardManager;
private var m_pulse:GameClient;
private var m_frogs:Array;
private var m_colors:Array;
private var m_myColor:ColorCard;
public var m_map:jjf.game.Map;
public var m_discard:Discard;
public var m_countDown:CountDownTimer;
private var m_endRound:Boolean;
The m_frogs property is an array of all the frogs. The m_colors property is an array
of all colors. The m_myColor property is initialized after successfully acquiring one of
the colors. Map is the class that is responsible for drawing the steps and frogs on the
screen. The screen also displays a discard switch button for players to discard a card
in hand instead of playing it; m_discard property is the sprite. When it is the player's
turn, the player must make the move in 10 seconds. To implement this, a countdown
timer is used. The countdown timer implementation is found in the util package of
the PulseUI framework. The property m_endRound is true when the game is finished
and turned to false when the game begins.
 
Search WWH ::




Custom Search