Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Advanced Database Systems For Integration Of Media And User Environments 98

Authors: Yahiko Kambayashi, Akifumi Makinouchi, Shunsuke Uemura, Katsumi Tanaka, Yoshifumi Masunaga

1st Edition

9810234368, 978-9810234362

More Books

Students also viewed these Databases questions