Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask C/C++ Expert


Home >> C/C++

Topic: Project C++: A player engine for RPG fighting

An engine is needed to create a player and non-playable character objects. Players will require an inventory of Weapons, Armor, and potions. Each fighter can equip armor and a weapon. Characters will start at a level one. At this will give them an attack power of 1, and a defense of 1.

Health is the number of health points player has.

Attack is the damage done to an enemy

Defense is how well you defend when attacked. The enemy must roll better than this to hit you.

Experience is the minimum needed to reach a specified level.

Player stats level 1 level 2 level 3 level 4 level 5 level 6 level 7 level 8 level 9

Health 10 15 20 25 30 35 40 45 50

Attack Power 1 2 3 4 5 6 7 8 9

Defense 1 2 3 4 5 6 7 8 9

Experience 0 20 40 80 160 220 440 880 1760

Weapons tell how well you can attack. The weapon must be equipped to use. Power bonus is added to players attack power during attack. This determines how much damage is dealt with an enemy if hit.

Weapon Sword Axe Dagger of Striking

Roll min 0 1 5

Roll max 10 10 15

Power bonus 0 1 3

Armor, when equipped, adds to defense, making player harder to hit during an attack.

Armor None Leather Chainmail

Defense bonus 0 1 3

Potions can be part of inventory and are needed for healing. (restoring health points of player).

For part one create player objects and inventory objects. Use test driver function calls to test that they are being created and that accessors and mutators work.

(Driver functions are functions used for testing and debugging.)

After creating your objects, the game needs to have a controller (or engine) to run. This is a recommended model of how to manage the game flow. (note if you have a different method that is ok as long as requirements are met.)

Note that I have a separate function called test that will allow me to run test code. I have made the choice value for this 99 (const int TEST = 99). I did this so I can call the test without the user knowing the debug option.

When the game starts, you should have a display similar to this:

Text Fighter v0.1

(((Press Enter)))

1: Play Game

2: Quit

Playing the game will then run the actual game. Thus generate the player character set the level, health, beginning armor.

A scenario should output; something like "An enemy comes into view ready to attack you. What do you do?" At this point a menu of options can show with options to attack, take potion (this is usually to heal), or run.

Attack will commence player to run an attack function against the enemy. Something like player.Attack(enemy);

After the player attack, the program should check if the enemy has health remaining. If not battle is over and rewards can be issued to the player. The player should have the option to equip and new weapons or armor (this can be done automatically if that's simpler.) experience should be rewarded. And then the player goes to next battle.

If the enemy does not die (enemy.currentHealth!=0 ) then enemy should attack; enemy.Attack(player);

If player health falls below 0 then player dies and the current game run should end. This should send the game back to the main menu.

Requirements for Grade:

These need to be present:

Player Object Class

Weapon Object class

Armor Object Class

Title Screen

Test Function

Used to test object creation and unit test functions

/> Game Engine

In game menu (or help display with control options)

Battle logic

Reward logic

Header file structure

These standards need to be met:

Program runs (no syntax errors)

Code is readable

Logic is clean (clean of most logical errors)

Attachment:- Assignment File.rar

C/C++, Programming

  • Category:- C/C++
  • Reference No.:- M92563757

Have any Question?


Related Questions in C/C++

1 implement the binary search tree bst in c using the node

1. Implement the Binary Search Tree (BST) in C++, using the Node class template provided below. Please read the provided helper methods in class BST, especially for deleteValue(), make sure you get a fully understanding ...

Assign ment - genetic algorithmin this assignment you will

ASSIGN MENT - GENETIC ALGORITHM In this assignment, you will use your C programming skills to build a simple Genetic Algorithm. DESCRIPTION OF THE PROGRAM - CORE REQUIREMENTS - REQ1: Command-line arguments The user of yo ...

What are the legal requirements with which websites must

What are the legal requirements with which websites must comply in order to meet the needs of persons with disabilities? Why is maximizing accessibility important to everyone?

Software development fundamentals assignment 1 -details amp

Software Development Fundamentals Assignment 1 - Details & Problems - In this assignment, you are required to answer the short questions, identify error in the code, give output of the code and develop three C# Console P ...

There are several ways to calculate the pulse width of a

There are several ways to calculate the pulse width of a digital input signal. One method is to directly read the input pin and another method (more efficient) is to use a timer and pin change interrupt. Function startTi ...

Assignment word matchingwhats a six-letter word that has an

Assignment: Word Matching What's a six-letter word that has an e as its first, third, and fifth letter? Can you find an anagram of pine grave. Or how about a word that starts and ends with ant (other than ant itself, of ...

Why do researcher drop the ewaste and where does it end

Why do researcher drop the ewaste and where does it end up?

Project - space race part a console Project - Space Race Part A: Console Implementation

Project - Space Race Part A: Console Implementation INTRODUCTION This assignment aims to give you a real problem-solving experience, similar to what you might encounter in the workplace. You have been hired to complete a ...

Question 1find the minimum and maximum of a list of numbers

Question: 1. Find the Minimum and Maximum of a List of Numbers: 10 points File: find_min_max.cpp Write a program that reads some number of integers from the user and finds the minimum and maximum numbers in this list. Th ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As