Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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.

  1. 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.

  2. 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.

  3. 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

blur-text-image

Get Instant Access to Expert-Tailored 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

Recommended Textbook for

Icdt 88 2nd International Conference On Database Theory Bruges Belgium August 31 September 2 1988 Proceedings Lncs 326

Authors: Marc Gyssens ,Jan Paredaens ,Dirk Van Gucht

1st Edition

3540501711, 978-3540501718

More Books

Students also viewed these Databases questions

Question

You have

Answered: 1 week ago