Reference no: EM132217609
Build a Fantasy Fighting arena combat game in C++ you will be designing and implementing a store with purchasable goods .
You will apply the use of Inheritance, Polymorphism, and File/O in your design and implementation. The following outline the minimum Fantasy Fighting Game requirements:
Create a text based fantasy arena combat game.
The game should consist of the following main elements:
A store to buy equipment (better weapons, better armor, more max-health)
An arena to fight for money.
Game logic using both store and arena.
The ability to save your player progress (Use file I/O for this).
The ability to load your player through Command line and Prompt.
The ability for the player to view their character sheet at will.
For this Topic, you will use inheritance to create a minimum set of classes for the following objects in the game:
- Base Classes:
o Inventory (base class for store and fighting characters)
o Salable item (base class for all salable items)
- Store Items:
o Weapon (inherited from salable item)
o Armor (inherited from salable item)
o Health (inherited from salable item)
o And others as you see fit You will derive a store class from the inventory base class.
You will derive things to buy from at least one category of goods to stock the store (at a minimum pick from weapon, armor, or health).
Your store will be initially be loaded with salable items that are created from input data loaded from a file. You will use the standard File I/O classes available in C++ for this part of the assignment.
The store should have a complete set of appropriate action methods (i.e. behavior). Examples include but not limited to putting a salable item in cart, remove a salable item from a cart, check out, print store items, print cart items, etc. Your salable items should also provide the appropriate interface and inherited behavior using your derived classes.
Examples include but not limited to cost/value, weight, etc. As you define your game logic your chosen category of goods could be expanded on the inherited characteristics as appropriate. A weapon, for example, could also have attack power, etc. The above information should be designed with extension in mind as these classes as they will all be reused when you finish writing your game in the next Topic.
For this project in particular, in addition to the above, you will code some driver logic in a main() that allows the user to interact and use the store. The store should first be instantiated and populated with at least 4 salable items created using input data loaded from a file.
The user should then be able to buy items, which are stored in a vector of salable items, such that any salable item can be stored in a “shopping cartâ€. When the user is done shopping and checks out from the store a list of the purchases should be printed to the screen along with the user's final money balance.
Store actions can be invoked from a simple menu system or as a series of inline code statements however all of the functionality of the store needs to be demonstrated. You are expected to sanity-check the user's input and require re-entry (or cancellation) of every invalid submission.