Question: Objective: To write a program application that simulates an RPG. Project Description: Design an RPG (Role Player Game) based upon the following instructions: Write a

Objective: To write a program application that simulates an RPG.

Project Description:

Design an RPG (Role Player Game) based upon the following instructions:

Write a program that simulates an RPG game. This is the first part of a sequence of laboratory projects that will build on each other.

For this first part, your program is to define the character and the characters role in the game. The program is written such that the user will choose from a list of available character roles.

The program also gives the character an initial level of health according to the characters particular role.

In future modifications, the player is given a certain goal or task to complete, usually accomplished in various steps or levels.

The gameplay, i.e., the maneuvers that the character will go through, move right, move left, pick up treasure, etc., also will be added in a future project.

Program Goals:

Input

Program user is prompted to select a character role

Program user responds by selecting a role

Process

The user selection is accepted and corresponding health is issued to the character

Output

Display the users role and the initial health

This is what I have so far...

// Program to demonstrate RPG

// written by Donald

#include

#include

using namespace std;

int main()

{

// declare variables

int selection = 0;

int health = 0;

char role[100];

char msg[100];

// prompt user for ...

cout << "welcome to the world of the Incursion ";

cout << "please select a role";

cout << " choose ... " << endl;

cout << "1 for Count Doom" << endl;

cout << "2 for the Countess of Crime" << endl;

cout << "3 for the Spartan Warrior" << endl;

cout << "4 for the Messenger of Incursion" << endl;

cout << "5 for Eddie Avinashi" << endl;

cin >> selection;

switch (selection)

{

case 1:

{

strcpy(role, "Count Doom");

strcpy(msg, "welcome ");

strcat(msg, role);

cout << msg << endl;

cout << "We hope your role will be successful! ";

cout << "you have ... 100% health" <

health += 100;

break;

}

case 2:

cout << "you have ... 75% health" << endl; break;

case 3:

cout << "you have ... 50% health" << endl; break;

case 4:

cout << "you have ... 25% health" << endl; break;

case 5:

cout << "sorry, you have ... 0% health" << endl; break;

default:

cout << "invalid entry ... try again later" << endl;

}

return 0;

}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!