This is an implementation of the board game Monopoly in C for windows and linux systems.
The game starts off at the welcome screen.
The player has the options to play Monopoly or view the rules of the game.
Player can select the game mode they wish to play with.
Players enter number of players and their names. The program emulates the players rolling a die to the player order based on the highest rolls.
A maximum number of 8 players can play.
This is where the actual gameplay starts. All players are assigned a colour and starting positions are set at START.
Each turn, each player who isn't in jail and bankrupt/given up is given options to roll, buy houses and hotels, sell properties they own or to give up.
Player rolls two dice each of 1-6 thus with a total possibility of 2-12. If the player gets doubles (the same number on both dice) the player gets to play again. If the player gets too many doubles, they are sent to jail for overspeeding.
After rolling, if the player lands on a purchasable tile, they are given the option to buy the property.
If the player has a sufficient balance of cash in hand, they can buy the property and a X of their colour is shown in the map.
If the player has completed a set, they are now allowed to buy a max of 4 Houses or a hotel if they have a sufficient balance. The player can build houses in only property type locations whose sets are completed. The player can only build a hotel if 4 houses have been built.
If the player owns x houses, xH of their colour is shown next to the property. If the player owns a hotel, HL of their colour is shown next to the property.
A list of properties the player owns is listed. On selection the property is sold and the player recieves the property value.
If a player gives up, they are automatically set to last and all their properties are available for other players to buy.
A player can be sent to jail when they land on "GO TO JAIL" or roll a certain number of doubles.
The player is given the option to pay a certain amount to get out or can stay for a certain number of turns.
If the player stays, at each turn, the number of turns to wait is displayed. The player cannot sell properties or buy houses/hotels when in jail.
Once the player has a value of less than -500 in cash in hand, they are set to bankrupted and can no longer play.
Based on the game mode chosen, the game ends.
If the game mode was NETWORTH, once a player reaches a certain amount, the game ends.
If the game mode was TURNS, once certain number of turns have passed, the game ends.
If the game mode was ENDLESS, once all players except one become bankrupt, the game ends.
After the game ends, a result screen of the game is shown. Players are arranges on their networth. Players who give up are at the bottom of the list disregarding their networths.
After the game ends, a thank you screen is shown.
To run the program, clone the repo and make the Makefile.
mingw32-make all
if using mingw32
Run on command prompt.
Monopoly.exe
NOTES: Before running the program, make sure command prompt is maximised and in full screen for best experience. Failure to do so can result undesirable outputs. Some screen resolutions are not supported.
Compiles all necessary files and creates .o files and places them in a folder called obj and makes Monopoly.exe
Directly compiles necessary files and creates Monopoly.exe
Compiles all necessary files and creates .o files and places them in a folder called obj.
Removes all .o and .exe files created during make all
.
- Might add terminal resizing.