Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

If anyone here is a C++ expert I really need help with coding this C++ console game like program according to the requirements I'm about

If anyone here is a C++ expert I really need help with coding this C++ console game like program according to the requirements I'm about to post below. I think it requires both header and cpp files. Please I'm almost out of time with this the requirements below are all that I can post I hope this is good enoughinformation!

a) Classes will be separated in header files and cpp files. So Ineed some class in a ".h" file and some in a ".cpp" file

b) Use C++ inheritance to define a series of classes.

BaseCharacter : should have a character name, number of hitpoints, position(like x and y coordinates, and a die() method whicheither player or enemy is terminated

PlayerCharacter : inherits from BaseCharacter. Has a pointer toa weapon object(like sword, bow, or ax)

EnemyCharacter : inherits from BaseCharacter. Has an enemyclassenumeration and pointer to weapon object(like sword, bow, orax)

BaseObj : has a name

WeaponObj : inherits from BaseObj. Has a type(can be Sword, Bow,or Ax), a damage value(each of these three weapons can havedifferent or random damage values), a doDamage() method(which dealsdamage)

c) Create a simple C++ console game program thatcreates 2 players and 2 enemies. The player and enemy taketurns attacking each other until one dies.

If anyone here's a C++ expert I would appreciate the help thankyou! I basically need a console program game in C++ that generates2 players and 2 enemy characters that will fight each other untilone side runs out of HP. The weapons they can wield can be either aSword, Ax, or a Bow. I'm sorry but this is all the info I can give.Also these are all the requirements given to me I can't post anymore requirements. I really hope this is good enoughinformation.Thank you!

Edit: The fight will begin with the players attacking firstbefore the enemies. The players and enemies for the enum can eitherbe swordsmen, archers, or ax wielders. Then the enemies will attackin return and so on until one side runs out of HP. Players willnever attack each other as the same is with the enemies as this isa tag team fight. They always target the opposing side. Enemy enummeans what type of enemy are they, same with the players with whatthey are as I mentioned before. They can be swordsman, ax men, orarchers. I hope this explanation helps to clear some things up! Ineed this in header and .cpp files thank you! Please I really needhelp again I hope this information is good enough!

Step by Step Solution

3.39 Rating (158 Votes )

There are 3 Steps involved in it

Step: 1

Below is a simplified implementation of the C console game based on the provided requirements The classes are separated into header files h and source files cpp BaseObjh cpp ifndef BASEOBJH define BAS... 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

Income Tax Fundamentals 2013

Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill

31st Edition

1111972516, 978-1285586618, 1285586611, 978-1285613109, 978-1111972516

More Books

Students also viewed these Electrical Engineering questions