Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Object oriented text-based game using java (images provided are here to show what is needed in the classes, zoom in on images to see them

Object oriented text-based game using java (images provided are here to show what is needed in the classes, zoom in on images to see them if you cannot see them already)

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed

The objective of this is to use objects and instances with a Room and Dungeon class and a Runner class to run the program. Using java.

required to build your game. A good rule of thumb is that you should divide the application's responsibilities into objects. You should use UML diagrams to determine the objects' properties and behaviors. In your adventure game the user explores a dungeon, which consists of a series of interconnected rooms. So, you must define a class that represents a room object and a dungeon object. Below are UML diagrams for our own implementation, but feel free to create your own or add more to ours. You may need more classes than we have if you added more game features, suggested additions could include: items, player, monster, traps, doors. Room Room Class Rooms are responsible for representing an area in the dungeon. The properties that define a room are its description and its exits. The room description may be stored using a String. For the exits, this room can hold references to other rooms that connect to it. The room constructor only sets up its description leaving its exits initially null. Client code can then update the room's Room - description: String -north:Room - east: Room -west: Room - south: Room > Room(description:String) + setNorth(north: Room) + setEast (east:Room) + setwest (west:Room) + setSouth(south: Room) + setExits(n:Room, e:Room, w:Room,som properties with getter and setter methods. It + getNorth) Room + getEast(): Room + getwest Room + getsouth): Room + getDescription): String + getExits): String +toString): String would be convenient to also have a method that can set all 4 exits at once. The room's description shouldn't say its exits; instead have a method (getExits) that creates a String of exits. The toString method should contain the description and the exits. UML class diagram for Room

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

Understanding Databases Concepts And Practice

Authors: Suzanne W Dietrich

1st Edition

1119827949, 9781119827948

More Books

Students also viewed these Databases questions

Question

What is the history of this situation?

Answered: 1 week ago

Question

6. Discuss the steps involved in conducting a task analysis.

Answered: 1 week ago

Question

8. Explain competency models and the process used to develop them.

Answered: 1 week ago