Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Help java code Help Java code 1. Player Class must have name, health(6) and score(0) 2. Game have commands pick, drop and use 1. pick

Help java codeimage text in transcribed

Help Java code 1. Player Class must have name, health(6) and score(0) 2. Game have commands "pick", "drop" and "use" 1. "pick" can pick up items (pick up items will add to the player score based on the item's score. 2. "drop" - drop item (dropping items will deduct score based on the item's score. 3. "use" can use items (addition health score will be added based on the items condition) 3. Items must have attributes name and score 4. items can be stored in arraylist "potion" "coin" "fruits" 1. potion (15 score) - add 30 health 2. coin(5 score) - add 50 to score 3. fruits (10 score) - add 20 health 5. Different Rooms 1. forest 2. garden 3. office 4. river 5. Objective to clear the game: 1. health must be 100 2. go to garden (you win) Example output: Player in garden Items in garden: fruits coin >> pick fruits Player picked fruits Add 10 to score Total Score: 10 Health: 0 >> pick coin Player picked coin Add 5 to score Total Score: 15 Health: 0 >> use coin Player use coin Add 50 to score Total Score: 65 Health: 0

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

Database Processing Fundamentals Design And Implementation

Authors: David M. Kroenke

5th Edition

B000CSIH5A, 978-0023668814

More Books

Students also viewed these Databases questions