- Lam Kam Chung, Sam (UID:3035788118)
- Leung Sin Wai, Jeffrey (UID:3035821544)
Monopoly is one of the most famous board games in the world. It is popular because of its easy-to-learn rules. We are trying to build monopoly game in C++ based on text. So that it can run by Linux(Academy11) Server. In case you do not know what is Monopoly, players roll dice to move across the game board in order to trade properties. Players will be given a certain amount of money when they pass through the starting point. Once players land on other players' property, players have to pay rent to the owner. Random events such as tax squares, Chance and Community Chest cards is also presented in this game. Player may gain or lose their money though the random events generated by stepping Chance and Community Chest or lose money when they land on a tax squares. The game runs until players go bankrupt in order to select the remaining winner.
It is a pleasure that we designed and made this game. We tried our best to implement different features that we proposed. This program can be run in Academy11 Server. However, the program documentation would be a bit messy, as we tried to passed vector in different files, it does not go well as we thought. We tried our best to solve it, but it actually goes beyond our knowledge on C++ coding. So we decided to move all functions to GameFunction.cpp. The original files are inside "Unnecessary files(for reference)", you may try to have a look to see our hard work on this game. Thank you.
- Each player can get $15000 at start.
- Rolling dice
- There are total of 40 squares in the board, meaning a total of 40 steps to roll for a loop.
- If the number of two dice match the same, that player is given a bonus roll. However, if it match the same for consequently 3 times, go to jail immediately.
- Events
- When players finish a loop (land on or pass through "START"), a $2000 reward a given.
- When players land on Income Tax Square, either pay 10% of total capital or $2000.
- When players land on Super Tax Square, pay $2000.
- Properties
- Players can buy a property on empty lands when they step on that square.
- They can only buy the lands when they have enough money.
- If a player steps on a land which is owned by another player, the player should pay the according rent.
- Player in jail can also receive rival's rent.
- Chance and Community Chest
- When players step on "Chance" square, something may happened...
- Same as land on "Community Chest" square.
- Jail
- When players step on “Go To Jail” square, go to jail immediately.
- When players get into jail, the jail will give you choices to make: either choose rolling dice or charge $50 to get out instantly.
- If the player choose charging $50, he can get out from jail and wait for next round.
- If which need to roll a double. If that player succeeds, he can leave. If not, wait for the next round.
- After 3 rounds of failure on rolling a double, player has to leave the jail with $50 force charge.
- Endgame
- The last player that remain from rival's bankruptcy would be the winner.
- Rolling of dice
- The rolling of dice is generated by a random function (Element 1)
- The total money amount of players
- Using dynamic memory management to update the current situation.(Element 2 & 3)
- Record the game status
- Game status is output to a file for recording. (Element 4)
- Chance and Community Chest cards
- Random events (Element 1)
- Contains different functions to different files (Element 5)
- Details would br included in "Headers used" session.
- Records and reading the users location
- Using class vector to store the players' information and using dynamic memory management update immediately.(Element 2 & 3)
- Jail
- Player will be skipped for maximum 3 turns. User status is updated by vector and using dynamic memory management update immediately.(Element 2 & 3)
- Quit
- Players can easily quit and save whithin the game while it is paused.
- main.cpp
- GameFunction.cpp
- GameFunction.h
- Makefile
- vector
- map
- GameFunction.h (responsible for printing game board, file saving & loading, record player information, board information)
Just run Makefile with all the necessary files within the same directory.
- Type in "make monopoly" with the correct directory.
- Type in "./monopoly" to run the game. Reminder: Remember enlarge to full screen to have full experience.