Question
Simple text-base adventure game java program. Create Room class with attributes roomIndex, description, and monster. It has an enter() methods that displays description of the
Simple text-base adventure game java program.
-
Create Room class with attributes roomIndex, description, and monster. It has an enter() methods that displays description of the room and the monster in the room, and then initiates a battle between player and monster. The class also has a isComplete() method and a toString() method.
-
A TreasureRoom class that inherits Room. A TreasureRoom has a String treasure, and an overrided enter() method that in addition to what Rooms enter() method does, if the player defeats the monster, displays a message that player finds the treasure.
-
A Battle class that has attributes player and monster. There is a run() method that let player and monster battle against each other until one of them dies. In each player turn, the method displays player hitPoints and monster hitPoints, then attack or heal following players command, and checks if monster is killed. In each monster turn, the method checks if the monster is going to enrage, then let the monster attack the player and checks if player is killed.
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