Game Development Reference
In-Depth Information
Multiplayer Game Example:
Tic-tac-toe
In this chapter, we will walk through the tic-tac-toe sample that is part of the freely
downloadable Pulse SDK package. We will focus solely on this sample, exploring
every class in detail that is involved in building this simple multiplayer game.
The walk-through starts with schema design for the game, then proceeds to the
subclassing of the PulseUI screen classes as required for this game, and finally
focuses on the game screen and gameplay implementation.
Tic-tac-toe, for those who are not familiar with it, is a turn-based game where each
player draws a circle or a cross in one of the available nine spots. If the player is able
to place three of their symbols in a straight line, either in a straight row, column, or
diagonally, then the player wins.
If neither of the players is able to make a straight line and there is no more room to
place the symbol, then the play is considered a draw—no one wins. If a player wins,
he or she will be a awarded a score of 1. The game round ends if one of the players
wins or the game is a tie. The board is cleared and a new round begins.
In this chapter, we will cover the following with regards to the multiplayer
tic-tac-toe game:
• The Schema design
• Subclassing from PulseUI
• Player turn management
• Implementing the game graphics
• Determining a win or a loss
Search WWH ::




Custom Search