Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Create a program that allows a user to play a dungeon maze game. Use the UML diag on the next page to help you create
Create a program that allows a user to play a dungeon maze game. Use the UML diag on the next page to help you create your classes. The dungeon maps, the item list, and the enemy list are all read in from text files and stored in their respective classes (do not assume the length of the enemy or item files). ram 1. Item - name, item's value Bag o' Gold - doesn't take up inventory, just add it to the hero's gold. b. a. Health Potion - buy/sell/heals for 25 c. Armor items- use an item's value for both maxHp and gold 2. Enemy - name, quip, hit points at level 1, magical or physical type creature a. Use the hero's level as a multiplier to calculate the hit points b. Construct enemy as magical or non-magical when generating 3. Map - 5x5 grid of characters a. s-start, f - finish, m-monster, i - item, n - nothing When the game starts, the hero is level 1 and begins at the start position of the first map Display a covered map to the user and have a marker to show where the hero is located Allow the user to choose a direction (North, South, East, or West) to explore the map 1. If the user enters a room with a monster, the user has the option of either attacking the monster or running away. If they attack, they choose to use swords or magic. They attack the monster for a random amount of damage based on the hero's level. The monster will attack back (if it's still alive), also for a random amount of damage based on the level. Repeat until the monster is dead or the user runs away. If they run away, then they will run in a valid random direction to an adjacent room (ie. not into a wall), and the monster stays where it is. If they defeat the monster, then they collect the item from the monster's corpse and the room is cleared. If they have a potion in their inventory, make a third option when fighting to use the potion to refill the hero's hit points, +25 or up to the hero's level max. If the hero dies, then the game is over. 2. If the user enters a room with an item, it is picked up and added to the hero's inventory and the room is cleared. The hero's inventory has a max capacity of 5 items, so if their inventory is already full, then the item is left where it was 3. If the user re-enters the start position, then they may sell the items in their inventory for the listed value, the gold is then added to the hero's gold. They also have the option to buy a potion for 25 gold if there is room in their inventory. 4. If the user enters the finish, then they have passed the level. The hero gains a level and the hero's maxHp increases by 10. The hero moves to the next map Re-load the first map for level 4, second map for level 5, etc Notes Item/EnemyGenerator classes read in the files in the constructor to make a list of templates. The generate functions randomly choose from the template list and construct new items/enemies (ie. do not return the template's reference). Make sure the enemies you create are of the right type (either physical or magical) When generating enemies, multiply by the hero's level to get the enemy's maxHp The armor in the hero's inventory adds the value to the hero's hit points . Use the Point class from the java.awt library to keep the location of the hero * Please so not add any extra data members or methods to the UML
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started