The goal of this assignment is to allow students to demonstrate their understanding of the features of the C++ language through the design and development of a simple console-based game. To achieve this goal the student will be required to complete the following steps:
There are two key dimensions to this assignment: (1) a demonstration of the software design and development process used by the student; and (2) the completed game that meets a minimum set of requirements. The assignment will require the submission of all documentation and source code for the game.
The following sections detail both the required/expected features of the game and the required documentation. A breakdown of marks to be awarded to each component is also given.
To achieve the goal of demonstrating a sufficient understanding of the C++ language, the submitted game software must contain appropriate examples of the following C++ mechanisms and features:
The style and setting for this game is left up to you. The type of game you choose must be sufficient to demonstrate the programming features listed above. Our recommendation is for you to constrain your software to a console application using ASCII characters (text) for display. Games suited to this format may include: an adventure game; a simple simulation/strategy game; or a maze/platform style game.
Pigs is a dice game of chance which involves two players trying to be the first to reach a score of 100 to win. The basic rules of the game ‘pigs’ is described below (as taken from Pig (dice) Wikipedia page):
Each turn, a player repeatedly rolls a die until either a 1 is rolled or the player holds and scores the sum of the rolls (i.e. the turn total). At any time during a player's turn, the player is faced with two options:
• roll – If the player rolls a
o 1: the player scores nothing and it becomes the next player's turn.
o 2 - 6: the number is added to the player's turn total and the player's turn continues.
• hold – The turn total is added to the player's score and it becomes the next player's turn.
The first player to score 100 or more points wins.
As you can see there are few rules to the game are and the gameplay is quite simple. An example of the playing of this game, showing only one round – that is each player having one turn – is shown below (also taken from Pig (dice) Wikipedia page):
For example, the first player, Ann, begins a turn with a roll of 5. Ann could hold and score 5 points, but chooses to roll again. Ann rolls a 2, and could hold with a turn total of 7 points, but chooses to roll again. Ann rolls a 1, and must end her turn without scoring. The next player, Bob, rolls the sequence 4-5-3-5-5, after which he chooses to hold, and adds his turn total of 22 points to his score.
The game pigs has a number of variations including the use of two dice. This could be implemented in your program through a menu choice ‘Options’ which sets the games parameters (i.e., number of dice, number of players, special Pig number [default is 1], or the winning score to end the game [default 100]).
Examples
The following are simple animated examples (using javascript and flash respectively). In your solution you are expected to only provide a text-based solution. These examples are only provided to support your understanding of how to play the game pigs:
• http://cs.gettysburg.edu/projects/pig/piggame.html
• http://scratch.mit.edu/projects/Paddle2See/1479420.
Some online examples of text-adventure like games that can be used for ‘inspiration’, include:
Also, think of some traditional games that may be used for inspiration:
Card and dice games may also be considered:
Word/text based games may also be considered:
PLEASE NOTE:
1) These games are only provided to give you some suggested ideas/themes, please feel free in creating a game of your choice – the requirement is that it must meet the generic features and functionality listed below!
2) Some of the games listed above require two players; in such cases it is not expected that students implement a complex “AI” computer opponent. It is sufficient for the second player can be controlled: manually using a different set of keys (or for each player to have a turn to provide input), or use of random moves/choices as performed in the lecture example of Tic-Tac-Toe.
In providing the required features (listed in the Demonstration of C++ Proficiency section above), the game must also support the following set of programming & gameplay features:
Additional features that you may wish to include for an additional 10% ‘bonus marks’ include: