Question
Create and code inJavaa simple text-based adventure game to make the character move in between rooms. The adventure game you will implement for this assignmentlike
Create and code inJavaa simple text-based adventure game to make the character move in between rooms.
The adventure game you will implement for this assignmentlike any of the text-based adventure games that were demonstrated by your classmates in class earlier this semestertakes place in a virtual world in which you, as the player, move about from one location to another. The locations, which are traditionally called rooms even though they may be outside, are described to you through a written textual description that gives you a sense of the geography. You move about in the game by giving commands, most of which are simply an indication of the direction of motion. For example, you might move about as follows:
The adventure program you will create for this assignment and all followed up assignments is entirely data driven. Just like your final project. The program itself doesnt know the details of the game geography, the objects that are distributed among the various rooms, or even the words used to move from place to place. All such information is supplied in the form of data files, which the program uses to control its own operation. The ultimate goal is if you run the program with different data files, the same program will guide its players through different adventure games.
For this first assignment, there must be an associated data file:
- Rooms.txt, which defines the rooms and the connections between them.
- You can also have two text files, one to define rooms and one to define connections.
- The number of the text file and the structure of the text files are entirely up to you as long as you accomplish the task.
For example, the room data file could have the following information:
- A room number, which must be greater than zero
- Its name, which is a one-line string identifying the room
- Its description, which is a multiline array describing the room
- A flag indicating whether the room has been visited
- A navigation table specifying the exits and where they lead
For example, this data file is not a Java program, but is instead text file that describe the rooms and their connections.
The program you will write for this assignment must:
- Read this file into an internal data structure, which it then displayed to the user on the console to guide the player through the game.
- Allow the player to be able to move between rooms by reading and executing navigation commands entered by the user through the console
- Your program should be able to track visited rooms and display the message visited on the console if the player revisit a room.
- A total of 6 rooms is required for this assignment with the following navigation command:
- North
- East
- South
- West
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started