Skip to content

An implementation of the board game monopoly in C, in your terminal.

License

Notifications You must be signed in to change notification settings

Mitul-Joby/Monopoly

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

C WINDOWS LINUX

Monopoly In C

This is an implementation of the board game Monopoly in C for windows and linux systems.

demo

THE GAME

Welcome screen

The game starts off at the welcome screen.

WelcomeScreen

Main Menu

The player has the options to play Monopoly or view the rules of the game.

MainMenu

Game Mode Menu

Player can select the game mode they wish to play with.

GameMode

Player Details

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.

PlayerDetails PlayerOrders

Main Game Starts

This is where the actual gameplay starts. All players are assigned a colour and starting positions are set at START.

MainGame

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

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.

PlayerRolls

After rolling, if the player lands on a purchasable tile, they are given the option to buy the property.

BuyProperty

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.

BUY HOUSES AND HOTELS

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.

BuyHotelHouse

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.

HousesHotels

SELL MENU

A list of properties the player owns is listed. On selection the property is sold and the player recieves the property value.

SellMenu

GIVE UP

If a player gives up, they are automatically set to last and all their properties are available for other players to buy.

Jail

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.

Jail

Bankrupt

Once the player has a value of less than -500 in cash in hand, they are set to bankrupted and can no longer play.

Bankrupt

GAME MODE BASED ENDINGS

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.

TurnsPassed

RESULTS

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.

Results

THANK YOU SCREEN

After the game ends, a thank you screen is shown.

ThankYou

Running the Program:

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.

Makefile Targets:

all

Compiles all necessary files and creates .o files and places them in a folder called obj and makes Monopoly.exe

Monopoly

Directly compiles necessary files and creates Monopoly.exe

OFiles

Compiles all necessary files and creates .o files and places them in a folder called obj.

clean

Removes all .o and .exe files created during make all.

Future Plans

  • Might add terminal resizing.