Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Project: Text-Based Adventure Game In this project you will create a simple text-based adventure game. The game will create a player object using information from

image text in transcribed
image text in transcribed
image text in transcribed
Project: Text-Based Adventure Game In this project you will create a simple text-based adventure game. The game will create a player object using information from a file, build a dungeon of three rooms each containing a monster, and allow the player to challenge the monster one-by-one and explore for treasure. The game will display messages on the screen to tell user what happens. It also creates a log file that keeps a record of the game. The program contains the following classes: (See Javadocs for detailed descriptions) I. A Creature class with attributes name, description, hitPoints, damage, and room. A creature object can attack and take damage. It also has an isAlive0 method and a toString0 method. 2. A Player class that inherits Creature. A player has an attribute healAmount, and a heal0 method that increase player's hitPoints by healAmount. 3. A Monster class that inherits Creature. A monster as an attribute enrageThreshold, and will be enraged (double its attack damage) if its hitPoints falls below the threshold. It has methods canEnrage0 and enrage0. 4. A Room class with attributes roomIndex description, and monster. It has an enter0 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 isComplete0 method and a toString0 method . A TreasureRoom class that inherits Room. A TreasureRoom has a String treasure, and an overrided enter method that in addition to what Room's enter0 method does, if the player defeats the monster, displays a message that player finds the treasure. 6. A Battle class that has attributes player and monster. There Isa runyenod that let player player finds the treasure. &1A'Battle class that has attributes player ana monster. There is a runO 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 player's command, and checks if monster is killed. In each monster turn, the method checks if the monster is goin,g to enrage, then let the monster attack the player and checks if player is killed. 7. A Game class with attributes player and dungeon. Dungeon is an array of 3 Room objects. There is a constructor that constructs the player object using information from a file, and constructs three monsters and three rooms with attributed given in the tables below. There is a play0 method that let the player enter the dungeon rooms one by one until the player die:s or clears all rooms. The method also updates the GameLog file as player progresses. 8. Finally, the Game class has a static main method that instantiates a Game object and runs the game. Hit Attack Enrage Points Damage Threshold Monster Roonm Name Index Description Covered with green 205 blood Funny how 40 10 it moves Orc Skeleton 1 10 Spout fire with each breath Fire Dragon Room Index 10020 40 Monster in Description A room with an unbearable smell Dark and cold A giant hall with something shiny on the other end the Room Orc Skeleton Fire Dragon Project: Text-Based Adventure Game In this project you will create a simple text-based adventure game. The game will create a player object using information from a file, build a dungeon of three rooms each containing a monster, and allow the player to challenge the monster one-by-one and explore for treasure. The game will display messages on the screen to tell user what happens. It also creates a log file that keeps a record of the game. The program contains the following classes: (See Javadocs for detailed descriptions) I. A Creature class with attributes name, description, hitPoints, damage, and room. A creature object can attack and take damage. It also has an isAlive0 method and a toString0 method. 2. A Player class that inherits Creature. A player has an attribute healAmount, and a heal0 method that increase player's hitPoints by healAmount. 3. A Monster class that inherits Creature. A monster as an attribute enrageThreshold, and will be enraged (double its attack damage) if its hitPoints falls below the threshold. It has methods canEnrage0 and enrage0. 4. A Room class with attributes roomIndex description, and monster. It has an enter0 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 isComplete0 method and a toString0 method . A TreasureRoom class that inherits Room. A TreasureRoom has a String treasure, and an overrided enter method that in addition to what Room's enter0 method does, if the player defeats the monster, displays a message that player finds the treasure. 6. A Battle class that has attributes player and monster. There Isa runyenod that let player player finds the treasure. &1A'Battle class that has attributes player ana monster. There is a runO 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 player's command, and checks if monster is killed. In each monster turn, the method checks if the monster is goin,g to enrage, then let the monster attack the player and checks if player is killed. 7. A Game class with attributes player and dungeon. Dungeon is an array of 3 Room objects. There is a constructor that constructs the player object using information from a file, and constructs three monsters and three rooms with attributed given in the tables below. There is a play0 method that let the player enter the dungeon rooms one by one until the player die:s or clears all rooms. The method also updates the GameLog file as player progresses. 8. Finally, the Game class has a static main method that instantiates a Game object and runs the game. Hit Attack Enrage Points Damage Threshold Monster Roonm Name Index Description Covered with green 205 blood Funny how 40 10 it moves Orc Skeleton 1 10 Spout fire with each breath Fire Dragon Room Index 10020 40 Monster in Description A room with an unbearable smell Dark and cold A giant hall with something shiny on the other end the Room Orc Skeleton Fire Dragon

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

More Books

Students also viewed these Databases questions

Question

9. Describe the characteristics of power.

Answered: 1 week ago