Question: ******Please use C++ and comment on the code to help me understand. TY!!!! One Hit Game: We are going to create a quick game that

******Please use C++ and comment on the code to help me understand. TY!!!!

One Hit Game:

We are going to create a quick game that has the following classes: Player

Data:

Health (have it equal 50)

Functions/Methods:

Receive Damage (Player receives 50 damage)

Boss

Data:

Health (have it equal 50)

Functions/Methods:

Player_Attack_1 (does 20 damage to Boss)

Player_Attack_2 (does 30 damage to Boss)

Player_Attack_3 (does 50 Damage to boss)

This is a game where there is one round of fighting between a player and a boss. If the user chooses the right attack, then the Boss dies instantly. If he chooses the wrong attack, then the Boss wins the game.

Set up the game like this:

  • Have some flavor text saying that a Boss has appeared
  • Have the player choose from a list of attacks (they can use numbers or text)
  • Whichever attack the player chooses, have it subtract from the boss's health.
  • If the Boss's health reaches zero from the attack, the player wins
  • Otherwise the Boss gets to attack the player, and win.

You can manipulate this game using loops if you wish, or do it a slightly different way, such as using a rand() to generated the attack, as long as the boss and player can fight and take damage.

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!