Question: In this lab, you are requested to develop the following: Create two headers ( . h ) files for player and explosive as described below.
In this lab, you are requested to develop the following:
Create two headers h files for player and explosive as
described below. These two files are going to be used in a game
development project.
Player:
Attributes
health: Integer
damage: Integer
manaPower: Integer
Methods
void attack
void applyDamage
Explosive:
Attributes
power: Integer
damage: Integer
spawnTime: Float
Methods
void explode
void applyDamage
Fill in the body of the functions to display a meaningful message on console. For instance,
the attack method of player may contain "Player is attacking".
Once you have implemented these two files, include them both in the file that contains the main
method. Then, call applyDamage method for both player and explosive.
Hint: you need to use "namespace" as we discussed in class.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
