Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: THEend8_
Project 3: Where in the Code is Carmen Sandiego
WHERE IN THE CODE IS CARMEN SANDIEGO
For the Final Project, you will implement a text-based adventure game in C++. This game adds a
creative, qUiRkY spin to the classic video game “Where in the World is Carmen Sandiego?” In
general, your mission (should you choose to accept it), you mega-elite haxxor lord, is to defeat 8
of carmensandiego101’s hackers to try and stop her nefarious information-stealing! Overall
dynamics consist of navigating across server rooms, weeding out hackers, and engaging in
combat with them. Along the way, you’ll acquire new languages and debugging skills and learn
how to lower your frustration on StackOverflow to prevent rage-quitting.
The game can be summarized by these core concepts:
1. The player buys supplies from Best Buy before starting the journey through the
hacker-infested server rooms.
2. There are five server rooms that you must explore in order to find hackers. Once you’ve
defeated between 1 - 3 hackers in the current room, you can move onto the next server
room.
3. Along the way, there are opportunities to i) visit Best Buy to buy items and upgrade your
equipment, ii) interact with potentially friendly non playable characters (NPC), iii) fight
hackers that you find during your exploration of the server room.
4. The game ends when the player has defeated, between 1 - 3 hackers in each of the 5
server rooms, when Carmen and her hackers progress to 100 steal all of the server’s top-secret files, when the player’s computer maintenance level reaches 0, or when the
hackers succeed in getting the player so frustrated that they rage quit.
Initial Conditions:
● At the beginning of the game, the player is asked to enter their name.
● The player is then placed in a Best Buy store. Before starting, the player can purchase
supplies from Best Buy. Best Buy has the following supplies for sale: computer parts,
antivirus software, virtual private network, and internet provider. More details on Best
Buy in the next section.
● After the player is done shopping, they are placed into the first server room.
● The player starts with a frustration level of 0. The game ends if the player’s frustration
level reaches 100.
● The player starts with 200 Dogecoins.
● The player has one computer. ● The player starts with internet provider level 1.
● The player starts with one virtual private network (VPN).
Visit Best Buy:
At the beginning of the game, the player has the opportunity to purchase things they might
need from Best Buy. Initially, the player is presented with information about what they might
need from Best Buy and why. In case the user wants to level up when inside a server room,
there is also 1 Best Buy located in each server room at a random location (which you are in
charge of spawning). Below is an example excerpt for the game, which you can also find in the
file “best_buy_info.txt”.
You have 200 dogecoins, 1 computer and 1 VPN. You will
need to spend the rest of your money on the following
items:
- COMPUTER PARTS. If your computer breaks, you need 5
computer parts to make a new one.
- ANTIVIRUS SOFTWARE. If your computer is infected with a
virus, use the antivirus software to get rid of it.
- VIRTUAL PRIVATE NETWORK (VPN). The more VPNs you have
the harder it is for a hacker to infect your computer with
a virus.
- INTERNET PROVIDER. The better the internet provider, the
more reliable your hacking will be.
You can spend all of your money here before you start your
journey, or you can save some to spend on a different
electronics site along the way. But beware, some of the
websites online are shady, and they won’t always give you a
fair price...
Present the player with the information about possible purchases. You can use some of the text
in the fragment above or you can modify it to include more information.
Then, ask the player if they wish to purchase things in the following 4 categories:
1. Computer Parts:
a. Best Buy recommends that the player should purchase at least 1 of each computer part
in case your main computer breaks. You can have a maximum of 3 of each computer
part and 1 extra premade computer. These are the different parts:
A CPU costs 10 Dogecoins
A GPU costs 20 Dogecoins
A Power Supply Unit costs 5 Dogecoins
A Computer Case costs 15 Dogecoins
An internet card costs 5 Dogecoins
A keyboard and mouse costs 10 Dogecoins
A premade computer costs 100 Dogecoins
b. Ask the player how many computer parts they wish to purchase.
c. Compute and print the current total cost so far.
2. Antivirus software:
a. One USB stick of antivirus software costs 10 Dogecoins and will give you a one-time use
to get rid of any viruses on your computer.
b. Ask the player how many antivirus USB sticks they would like to purchase.
c. Compute and print the current total cost so far.
3. Virtual Private Network (VPN):
a. A VPN costs 20 Dogecoins each. VPNs reduce your chances of getting hacked by
preventing hackers from tracking down your main computer. The increase in security
maxes out at 2 VPNs.
b. Ask the player how many VPNs they would like to purchase.
c. Compute and print the current total cost so far.
4. Internet Provider:
a. Internet provider level 2 costs 10 Dogecoins
b. Internet provider level 3 costs 25 Dogecoins
c. Internet provider level 4 costs 40 Dogecoins
d. Internet provider level 5 costs 50 Dogecoins
e. Ask the player what internet provider level they would like to buy. They can upgrade
their internet provider at a later time if they so desire.
f. After the player selects an internet provider, compute and print the current total cost so
far.
g. Having a better internet provider increases the player’s chances of winning a hacker
battle.
Note 1: At any time in the buying process, if the player is attempting to buy an item (or a
number of items of the same kind) whose price exceeds the money the player has in hand, print a message to the player informing them they do not have enough money and ask them to
choose another quantity of the item in question.
Note 2: The player can choose to purchase items in a certain category multiple times during the
same store visit. For example, the player might choose the purchase of VPNs, followed by computer parts, then VPNs again, then more computer parts, then an internet provider, but no
antivirus. After every new set of items added, your program should print the total cost so far.
Best Buy will be located at a random position in each server room except for the first room
where it will be located at the player’s initial position. The prices at the stores along the trail get
progressively higher as you get further along. In the second server room, the prices will be 10%
higher than the ones at the starting location. In the third room, they will be 20% higher. In the
fourth room, 25% higher. In the fifth room 30% higher.
During your mission, after each move, you will automatically mine a certain amount of
Dogecoin that will be added to your Dogecoin amount. No matter what, you will gain 5
Dogecoin each turn. With each GPU that you have in your inventory, you can gain an additional
5 Dogecoin. For example, if you have 2 GPUs, you will be able to get 15 Dogecoin after each
move.
Using the given Map class: We provide a fully-implemented Map class that you will need to figure out how to use in your
code. The Map class defines a 2D map of size 5x9 and stores data in a mapData array of type
char. This array contains characters that represent player, Best Buy, NPC, and Hacker locations as
well as empty spaces. Setters and getters are provided for player position. Spawn functions are
provided for Best Buy, NPC, and Hacker that places these entities in mapData. Functions for
displaying the map in the terminal and moving the player around the map are also given.
mapDriver.cpp shows how you may use the class by first initializing a Map object and spawning
any entities relevant to this game (NPC, Best Buy, Hacker). The for-loop allows the player to execute 10 moves around the map, displaying the map after each move and printing a confirmation message if the player lands on any of the spawned entities.
You may modify this class in any manner you see fit -- by changing the types of entities, the size
of the map, etc. But you must use a 2D map as part of your project.
‘x’ corresponds to the player position, ‘B’ represents the Best Buy location, and ‘N’ is the NPC
location. Hacker locations are not shown on the map. Player always starts at (0, 0). An example
output will look something like this:
The map class will have seven functions that you can use.
1. void displayMap()
a. Prints the map on the terminal as seen above.
2. void displayMoves()
a. Prints the valid moves a user can take using the w, a, s and d keys
3. int getPlayerRowPosition()
a. Returns the players row position index
4. int getPlayerColPosition()
a. Returns the players column position index
5. bool isNPCLocation()
a. Returns true if the player’s current position is the NPC location
6. bool isBestBuyLocation()
a. Returns true if the player’s current position is a Best Buy location
7. bool isHackerLocation()
a. Returns true if there is a Hacker at the player’s current position