QuestionQuestion

You will design and implement a text-based game where the player moves through a room or compartment based structure. They will need to gather items to achieve some purpose. The details are left to you!   

Specific requirements.
You will create a series of rooms for the player to move through. Each room will be a class with (at least) four pointer variables that link to other parts of the structure. Your structure can be linear such as a train. You still need to have four pointer variables in the class. Be creative and try to use them all! For secret passages or “stepping” outside? You need to have at least 5 rooms. You will have a room superclass that will not be implemented. You will have at least 3 derived classes for different types of rooms that have unique characteristics or functions other than just a different name. To continue with the train theme you could have a passenger car, baggage car, or Pullman (sleeper car). Or one ‘room’ could have controls such as the engine.

You must have a goal for the player. Maybe it is solve a crime (like Clue?). Maybe the aliens have invaded your spaceship but normal weapons do not work! Your player finds that aliens do not like broccoli either. Based on your theme the player must discover the solution. You may have a random way to achieve the goal, hidden from the user. One time it is the broccoli, and then next it is a pillow. It could be a haunted house and the player needs to find the key to letting the ghost get to its final peace?   
You must have some way to keep track of which room the player is in. In addition to the location, the player will have a bag (backpack, attaché, or knitting bag) to carry items. The bag must have some limit. One of more of these items should be required as part of the solution, such as a key to the mysterious room (which may not be a physical key or not even a single item).

The goal may be a puzzle with clues in each room. It does not need to be a physical possession. It should not require free-form input. It is frustrating to not win because you did not spell something correctly. You should have a time limit of some sort to urge the player on. This does not mean a literal clock, just some way to prevent the ‘game from going on indefinitely. The player must interact with parts of the structure, and not just simply collect things. This can be throwing something at the monster, operating a light switch (or other control), opening doors, or singing to get the baby back to sleep.   Up to you. You must develop a theme for your game. Make it interesting, if not fun.

PROGRAMMING.   Your theme adds a lot of color. The programming is a matter of classes/objects and links. Each room class will have 4 links. Using a set number simplifies your programming with a single class. Each link does not need to be a door to another room. They can be access to a hidden closet When entering a room you must give the user her options, basically listing the doors they can see. They may or may not see the trapdoor to a hidden compartment. Work on this first! After your player can move through all the rooms the rest is just adding functions for each type of room.   You can use more links if you want but that will change your class hierarchy.   

What to submit in your zipfile.   
• Your makefile
• Source and header file for each of your 4 classes (maybe more)
• Source and header file for your program code
• Your reflections document

Solution PreviewSolution Preview

This material may consist of step-by-step explanations on how to solve a problem or examples of proper writing, including the use of citations, references, bibliographies, and formatting. This material is made available for the sole purpose of studying and learning - misuse is strictly forbidden.

#include <cstdlib>

using namespace std;
#include "definition.h"
#include "Room.h"
#include "BaggageCar.h"
#include "Pullman.h"
#include "PassengerCar.h"
#include "Engine.h"
#include "Roof.h"
#include "Character.h"

int main(int argc, char** argv) {
   
    srand(time(0));
    Room * room[5];
    room[0] = new BaggageCar();
    room[1] = new Pullman();
    room[2] = new PassengerCar();
    room[3] = new Engine();
    room[4] = new Roof();
   
    for (int i = 0; i < 5; i++) {
       for (int j = 0; j < 5; j++) {
            if (room[i] != room[j]) {
                room[i]->addDoor( room[j] );
            }
       }
    }
   
    int selection;
    string name;
    double height;
    cout << "Enter your name: ";
    getline(cin, name);
    cout << "Enter your height(m): ";
    cin >> height;...
$80.00 for this solution

PayPal, G Pay, ApplePay, Amazon Pay, and all major credit cards accepted.

Find A Tutor

View available C-Family Programming Tutors

Get College Homework Help.

Are you sure you don't want to upload any files?

Fast tutor response requires as much info as possible.

Decision:
Upload a file
Continue without uploading

SUBMIT YOUR HOMEWORK
We couldn't find that subject.
Please select the best match from the list below.

We'll send you an email right away. If it's not in your inbox, check your spam folder.

  • 1
  • 2
  • 3
Live Chats