QuestionQuestion

Build a text adventure game similar to the classic Colossal Cave game. Your adventure game must include at least "rooms" and "items". The player of the game should be able to collect, move and "use" items in order to complete the adventure. Actions taken by the player should depend on several factors: which "room" the player is in, what item(s) the player has, what item(s) are in the current "room", and what actions have previously been taken.

Your solution should include at least the following OO features:
• data hiding / encapsulation
• polymorphism / inheritance / "is a"
• member "has a" relationship with a non-trivial object (Box "has a" left, but double is a trivial type so that wouldn't count)
• pointer "has a" relationship with a non-trivial object (Polygon "has a" pts, but double[] is a trivial type so that wouldn't count)
• "knows a" relationship (with a non-trivial, non-owned object)

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.

#ifndef CHARATER_H
#define CHARATER_H

#include<string>
using namespace std;

class Charater {
public:
    Charater();
    Charater(const Charater& orig);
    Charater(string & n, int & h, int & p, int & a);
    virtual ~Charater();
    virtual int hit() = 0; // attack, return attack power
    virtual void getHit( int & p) = 0 ; // pure virtual method
    bool isDied() ;
    string getName();
protected:
    string name;
    int health;
    int initPower;
    int armor;
};

#endif /* CHARATER_H */...
$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