Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++ Create a Game! SKILL SET: Using abstract base classes, polymorphism and virtual functions Write a program that uses class, inheritance, and polymorphism to have

C++
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
Create a Game! SKILL SET: Using abstract base classes, polymorphism and virtual functions Write a program that uses class, inheritance, and polymorphism to have three different kinds of characters battle in a simple game. There are three different types of characters but they have some common characteristic that will be in an abstract base class called Character Character has the following data: Name Health points (HP) Points to next level .Experience points (XP)-everyone starts at 0 .MaxHP (same as starting HP) You will derive three new classes from this base class: Novice: has the additional attribute of luck (int) .Knight: has the additional attribute of weapon name, weapon power(int), armor(int. Wizard: has the additional attribute of magic poiwer source (divine or arcane) (int) Attribute Values (feel free to the actual the idea is that they all have different values) Wizard HP starts at 100 XP starts at 0 Novice HP starts at 120 XP starts at 0 HP starts at 80 XP starts at 0 Points to next level starts Points to next level starts at Points to next level starts at 10 at 10 Luck starts at (0 or 1 10 Armor starts at I am suggesting a very simple system in terms of fighting. When fighting during the game, a character generates attack (damage) points as described below. Compare the attack points to the strength (AC) of the monster . If player's attack is greater than AC then you win You gain experience points. UpdateXP based on the monster's level points. When XP reaches a certain amount (points to next level) you "level up" and gain some increase in all stats Otherwise you lose. You lose hit/health points. UpdateHP with the monster's AC This way you are not keeping up with the HP of the monster But if you want to make different rules that's fine, just write it up in your lab raport [If you want to do separate "attack and "damage" points, feel free. Just describe your system in your lab report NOTE: feel free to adjust any of these numbers. The idea is that the three classes have DIFFERENT behaviors. Novice A random number A random number A random number from 5- from 1-10luck from 10-20 Wizard 15 magic bonus 5 points if divine) Knight Attack points + weapon power (2 points if arcane, XP Plus monster levelPlus (monsterPlus (monster level 2) level 1 Game Lab Page l Create a Game! SKILL SET: Using abstract base classes, polymorphism and virtual functions Write a program that uses class, inheritance, and polymorphism to have three different kinds of characters battle in a simple game. There are three different types of characters but they have some common characteristic that will be in an abstract base class called Character Character has the following data: Name Health points (HP) Points to next level .Experience points (XP)-everyone starts at 0 .MaxHP (same as starting HP) You will derive three new classes from this base class: Novice: has the additional attribute of luck (int) .Knight: has the additional attribute of weapon name, weapon power(int), armor(int. Wizard: has the additional attribute of magic poiwer source (divine or arcane) (int) Attribute Values (feel free to the actual the idea is that they all have different values) Wizard HP starts at 100 XP starts at 0 Novice HP starts at 120 XP starts at 0 HP starts at 80 XP starts at 0 Points to next level starts Points to next level starts at Points to next level starts at 10 at 10 Luck starts at (0 or 1 10 Armor starts at I am suggesting a very simple system in terms of fighting. When fighting during the game, a character generates attack (damage) points as described below. Compare the attack points to the strength (AC) of the monster . If player's attack is greater than AC then you win You gain experience points. UpdateXP based on the monster's level points. When XP reaches a certain amount (points to next level) you "level up" and gain some increase in all stats Otherwise you lose. You lose hit/health points. UpdateHP with the monster's AC This way you are not keeping up with the HP of the monster But if you want to make different rules that's fine, just write it up in your lab raport [If you want to do separate "attack and "damage" points, feel free. Just describe your system in your lab report NOTE: feel free to adjust any of these numbers. The idea is that the three classes have DIFFERENT behaviors. Novice A random number A random number A random number from 5- from 1-10luck from 10-20 Wizard 15 magic bonus 5 points if divine) Knight Attack points + weapon power (2 points if arcane, XP Plus monster levelPlus (monsterPlus (monster level 2) level 1 Game Lab Page l

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

Database Modeling And Design

Authors: Toby J. Teorey, Sam S. Lightstone, Tom Nadeau, H.V. Jagadish

5th Edition

0123820200, 978-0123820204

More Books

Students also viewed these Databases questions

Question

Explain walter's model of dividend policy.

Answered: 1 week ago

Question

3. Write a policy statement to address these issues.

Answered: 1 week ago