Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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.
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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

Students also viewed these Databases questions