Go to https://replit.com/@rammonsnova/SimpleCombatstructuredstarter#main.cppLinks to an external site.
Fork a copy to your account.
Rewrite/modify the game to use player objects instead of the “structured” programming approach currently used.
That is, implement the Player class. (40pts)
Use two objects of type Player throughout the program. (20pts)
Minimum requirements:
Player class must have at least three (3) public methods. (10pts)
Player class fields/variables must be all (or almost all) private. (10pts)
Program must use random numbers in a reasonable range (e.g., 1-3) for attack values that change each turn. (10pts)
Either: (10pts)
create a Game class that implements the game logic, or
create a function that outputs the players’ HP as well as the prompt to attack or use potion (defend) — basically a display function
Rewrite/modify the game to use player objects instead of the “structured” programming approach currently used.
Share