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) . 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. 5. A TreasureRoom class that inherits Room. A TreasureRoom has a String treasure, and an overrided enter) method that in addition to what Room's enterO 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 is a run0 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 going 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 dies 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 Monster Room Name Index Hit Attack Enrage Points Damage Threshold Description Covered Ore with green 205 blood Funny how 40 Skeleton 1 10 10 it moves Spout fire breath Fire Dragon 2 with each 100 20 40 Monster in the Room Koom Description A room with an unbearable smell Dark and cold A giant hall with something shiny on the other end Index 0 rc Skeleton Fire Dragon Each student is require to present the program in class. Grading rubric is as follows: Pts Student presents the program on presentation day Monster Room Description Points Damage Hi Attack Enrage Name Index Covered with green 20 blood Funny how it moves Spout fire Orc 5 Skeleton1 40 10 10 Fire Dragon 2 with each 100 20 40 breath Room Description Index Monster in A room with an unbearable smell Dark and cold A giant hall with something shiny on the other end the Room Ore Skeletorn Fire Dragon 0 Each student is require to present the program in class. Grading rubric is as follows: Student presents the program on presentation day The program can create a player object The program generates a dungeon properly The program displays the description of the first dungeon room The program initiates a player-monster battle. 10 The program correetly performs one player10 Pts 10 10 10 10 action according to user's choice The program finished a player-monster battle. 10 The game was completed properly. The program handles negative player hitpoints s 10 correctlv The program handles negative damages correctly 5 The game play messages were correctly written to the GameLog.txt file Total 10 100 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) . 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. 5. A TreasureRoom class that inherits Room. A TreasureRoom has a String treasure, and an overrided enter) method that in addition to what Room's enterO 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 is a run0 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 going 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 dies 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 Monster Room Name Index Hit Attack Enrage Points Damage Threshold Description Covered Ore with green 205 blood Funny how 40 Skeleton 1 10 10 it moves Spout fire breath Fire Dragon 2 with each 100 20 40 Monster in the Room Koom Description A room with an unbearable smell Dark and cold A giant hall with something shiny on the other end Index 0 rc Skeleton Fire Dragon Each student is require to present the program in class. Grading rubric is as follows: Pts Student presents the program on presentation day Monster Room Description Points Damage Hi Attack Enrage Name Index Covered with green 20 blood Funny how it moves Spout fire Orc 5 Skeleton1 40 10 10 Fire Dragon 2 with each 100 20 40 breath Room Description Index Monster in A room with an unbearable smell Dark and cold A giant hall with something shiny on the other end the Room Ore Skeletorn Fire Dragon 0 Each student is require to present the program in class. Grading rubric is as follows: Student presents the program on presentation day The program can create a player object The program generates a dungeon properly The program displays the description of the first dungeon room The program initiates a player-monster battle. 10 The program correetly performs one player10 Pts 10 10 10 10 action according to user's choice The program finished a player-monster battle. 10 The game was completed properly. The program handles negative player hitpoints s 10 correctlv The program handles negative damages correctly 5 The game play messages were correctly written to the GameLog.txt file Total 10 100

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_2

Step: 3

blur-text-image_3

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

Professional Microsoft SQL Server 2014 Administration

Authors: Adam Jorgensen, Bradley Ball

1st Edition

111885926X, 9781118859261

More Books

Students also viewed these Databases questions