Question
To design and implement a board game using inheritance and polymorphism. For this programming project, you and your partner will be writing a Java application
To design and implement a board game using inheritance and polymorphism.
For this programming project, you and your partner will be writing a Java application that implements the Monopoly Junior (2013 Standard North American Edition) board game using derived classes from an abstract class that represents a space on the game board.
Start of Play
- Assume all 4 players are playing.
- Toy Boat
- Toy Car
- Little Hazel
- Little Scottie
On each turn
- All players start at GO.
- Player rolls the die and moves position that number of spaces clockwise from GO.
- Always move forward, never backward.
- Every time player passes or lands on the GO space collect $2!
- Refer to the different spaces on the board to determine what happens if player lands on it.
Game end
- The game will end when a player goes bankrupt. A player will be bankrupt if:
- hasnt got the cash to pay rent,
- buy a property they land on, or
- Pay a Chance card fee.
The Board Spaces
- GO
- Player collects $2 from the Bank every time player passes or lands on GO.
- Randomly choose one of the 20 CHANCE cards
- Advance to a light blue or red space. If one is unwonted, get it for FREE! If none is unwonted, advance to the closest light blue or red space and PAY rent to the owner.
- Advance to an orange or green space. If one is unwonted, get it for FREE! If none is unwonted, advance to the closest orange or green space and PAY rent to the owner.
- Advance to a pink or dark blue space. If one is unwonted, get it for FREE! If none is unwonted, advance to the closest pink or dark blue space and PAY rent to the owner.
- Advance to a red space. If one is unwonted, get it for FREE! If none is unwonted, advance to the closest red space and PAY rent to the owner.
- Advance to a light blue space. If one is unwonted, get it for FREE! If none is unwonted, advance to the closest light blue space and PAY rent to the owner.
- Advance to an orange space. If one is unwonted, get it for FREE! If none is unwonted, advance to the closest orange space and PAY rent to the owner.
- Advance to a brown or yellow or blue space. If one is unwonted, get it for FREE! If none is unwonted, advance to the closest brown or yellow or blue space and PAY rent to the owner.
- Advance toBoardwalk.
- Move forward5
- Move forward 1 spaceortake another Chance card.
- Advance toGO. Collect $2
- Advance to theSkate Park. If no one owns it, get it for FREE! Otherwise, PAY rent to the owner.
- Get out of jail free. Keep this card until you need it.
- You did all your homework!Collect $2from the Bank.
- Its your birthday!Collect $2from the Bank. Happy Birthday!
- You ate too many sweets!Pay $2to the Bank.
- Give this card to theToy Boat, and take another Chance Card.
Toy Boat: on yournext turn, sail forward toanyunwonted property, and buy it. If all are owned, buy the closest property not owned by Toy Boat from the owner! Owner MUST sell.
- Give this card to theToy Car, and take another Chance Card.
Toy Car: on yournext turn, sail forward toanyunwonted property, and buy it. If all are owned, buy the closest property not owned by Toy Car from the owner! Owner MUST sell.
- Give this card to theLittle Scottie, and take another Chance Card.
Little Scottie: on yournext turn, sail forward toanyunwonted property, and buy it. If all are owned, buy the closest property not owned by Little Scottie from the owner! Owner MUST sell.
- Give this card to theLittle Hazel, and take another Chance Card.
Little Hazel: on yournext turn, sail forward toanyunwonted property, and buy it. If all are owned, buy the closest property not owned by Little Hazel from the owner! Owner MUST sell.
- GO TO JAIL
- Go straight to jail! Do not pass GO. Do not collect $2 at the start of your next turn, pay $1 or use the Get out of Jail Free card if you have it. Then roll and move as normal. You can collect rent while In Jail.
- JUST VISITING
- Do nothing.
- FREE PARKING
- Do nothing.
- AN UNOWNED SPACE
- If no one owns it, you must buy it!
- Pay the Bank the amount specified for the space.
- Change the state of the space to Owned with the corresponding Owner.
- AN OWNED SPACE
- If another player owns it, pay the owner the specified rent amount.
- If you own it, do nothing.
- A PAIR = DOUBLE RENT!
- If a player owns both properties of the same color, rent is double the specified rent amount.
Properties
- Brown Spaces
- Burger Joint $1
- Pizza House $1
- Ice Cream Parlor $2
- Candy Store $2
- Ice Cream Parlor $2
- Candy Store $2
- Library $2
- Museum $2
- Swimming Pool $3
- Skate Park $3
- Video Arcade $3
- Movie Theater $3
- Toy Store $3
- Pet Store $3
- Bowling Alley $4
- The Zoo $4
- Park Place $5
- Boardwalk $5
PROJECT REQUIREMENTS:
You are required to write the following classes:
- Board Space: This should be an abstract class with one or more abstract methods. The class should at least have one abstract method called on Landing (). The definition of this method in the derived concrete classes should:
- update the players cash balance,
- update the players position on the board, and
- If class is a property, update the state of the property (owned/unwonted, and owner).
- Chancecards class that represents the set of cards randomly chosen by a player, as needed.
- Go
- Jail
- Just Visiting/Free Parking
- Property
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started