Development of a simple menu driven text adventure

Assignment Help Programming Languages
Reference no: EM13725430

Assignment 1 - Development of a Simple Menu Driven Text Adventure
Please see the Course Description for further information related to submission date, extensions for assignments and Special Consideration. You may be required to demonstrate your working code to your tutor in your lab class.
Project Overview
For this assignment you will be provided with incomplete sample starter code that you can modify and build upon. Your task will be to carry out the design, analysis, coding and testing to add several additional features to this sample code. You are expected to fully comment the provided code as well as your own code. This project will implement a simple menu-driven text adventure. Text adventure games were very popular in the early days of computer gaming, as they could run even on low-end computer systems which could not support advanced graphics. The player controlled a character within an environment such as a fantasy castle or a spaceship. The environment was made up of a series of interconnected locations, which were described to the player by written descriptions. By entering short text commands such as "go north" or "get key" the player could explore these locations, pick up and use objects within the environment, fight enemies and so on. Generally the player had to solve a series of puzzles to enable them to achieve a goal in the game such as reaching a goal location where treasure was stored. Many of the classic text adventures are now freely available online, so if you are interested you may want to try some of them:
• Colossal Cave (the first text adventure)
• The Hobbit (made in Melbourne!)
• The Hitchhiker's Guide to the Galaxy:
Developing a complete text adventure is too challenging at this stage of the course, so we will make a number of simplifications:
• To avoid having to process commands made up of one or more words, all user input will be through a numeric menu.
• Interaction with objects in the game will be very limited.
The provided partial solution source code implements some fundamental aspects of the text adventure:
• The use of arrays (both 1D and 2D) to store information about the map which defines the game world, the descriptions of locations, and the description and location of game objects
• A simple numeric menu which the player uses to enter commands
• The ability for the player to move between locations in the game world by moving in the four cardinal compass directions (north, east, south and west
Project Specification
Your task will be to first answer some questions testing your comprehension of the partial solution, and then to extend this partial solution to provide additional features:

1. Answer the questions listed below under Part A - save your answers into a Word document for submission along with remainder of your assignment.

2. Design your own unique game world, which must exhibit the following characteristics:

a. It should consist of between 10 and 20 interconnected locations (please don't exceed this limit as it will slow down the marking process)

b. All eight possible directions of movement (N, S, E, W, NE, SE, SW, NW) must be used at least once in the game map.

c. The world should contain 10 objects. At least one location must contain no objects, and at least one location must contain multiple objects.

d. Every location and object must have its own unique description.

e. There must be a specified ‘goal' location which the player is aiming to reach - this will be used later within Stage 6 of the project. Your design should be clearly documented in the form of a world map and table of descriptions similar to the example provided on model.

3. Extend the menu and related code so that the player can also move in the ordinal directions (northeast, south-east, south-west, north-west)

4. Modify the program code and data so as to implement the game world designed in Stage 2.

5. Add a ‘quit' option to the menu, and modify the loop in the main () method so that it exits if the user enters this command.

6. Further modify the loop so that it exits and displays a suitable congratulatory message if the player reaches a specific ‘goal' location within the game-world.

7. Modify the room description method so that the player automatically picks up any objects in their current location. If the room description is redisplayed, those objects should no longer be listed as being in that location (hint: use a special value such as -1 to indicate that an object is in the player's possession).

8. Add an additional ‘inventory' command to the menu and implement a method which is called when this command is entered, which will list all of the objects currently in the player's possession.

9. Now that no further commands will be added to the menu, modify the menu code to ensure that a valid selection has been made by the player. If not, display an error message and prompt them to enter a new value. Repeat this until valid input is obtained.

10. This is the most advanced aspect of the project - do not attempt this unless you have all the other requirements working. Modify the program code so that the goal location cannot be entered unless the player is carrying a particular object (e.g. a key). If the player tries to enter the room without this object then an appropriate message should be displayed. For full marks for this section, your solution should be easily applicable to other game worlds (for example worlds with multiple locked doors).
The Assessment section of the moodle site contains a video demonstrating a fully working version of the program which should help to clarify these requirements.

Resources Provided

The following files/links are available on Moodle:
• An electronic copy of this assignment specification sheet
• The General Guide for the Presentation of Academic Work
• A sample incomplete program to get you started (TextAdventure.java)
• A video of a complete version of the project
• A sample design document for the game world used in the video.

NOTE: If you use any resources apart from the course material to complete your assignment you MUST provide an in-text citation within your documentation and/or code, as well as providing a list of references in APA formatting. This includes the use of any websites, online forums, books or text books. If you are unsure of how to do this please ask for help.

Part A - Code Comprehension

Sample code has been provided in Moodle. Use the sample code provided to answer the following questions. Save your answers in a Word or pdf file, and include that file in your assignment submission:

Question 1: Explain why NO_EXIT has been declared and used in defining the contents of the map array, rather than just directly using the value 99999 in the map array definition.

Question 2: What is the value stored in map[2][1]? What is the interpretation of this value in terms of the structure of the game world?

Question 3: Explain what change would need to be made to the code in order for the potato object to be in the logcabin rather than the clearing.

Reference no: EM13725430

Questions Cloud

Examine the shift in bauhaus design from the ideals : Examine the shift in Bauhaus design from the ideals of the Arts and Crafts movement to an attempt to forge a new and positive alliance of art and industry.
Introduction to the hfi suite of methodologies : Risk and Safety for ABC Transport. Our company works with others across the supply chain, servicing on a contractual basis clients with our fleet of 20 B- Double Vehicles.
Makeup of the workforce : Question 1: Describe how changes in population affect the makeup of the workforce. Question 2: How will accomplishing these objectives support your success in management? What risks or challenges might a manager encounter if they have not mastered..
How business handles diversity policies and practices : Explain how business handles diversity policies and practices
Development of a simple menu driven text adventure : Explain why NO_EXIT has been declared and used in defining the contents of the map array, rather than just directly using the value 99999 in the map array definition
Section of a diversity training manual : As the new human resources manager, you are now ready to complete the next section of a diversity training manual that is targeted at making your workforce supervisors more aware of current racial diversity issues
What is richmond corporation''s total net cash flow : Richmond Corporation was founded 20 years ago by its president, Daniel Richmond. The company originally began as a mail-order company but has grown rapidly in recent years, in large part due to its Web site. Because of the wide geographical dispersio..
Sells protective covers for all popular smart phone brands : The Cell Phone Shop sells protective covers for all the popular smart phone brands. The company has determined that it needs a 60% mark up on retail price in order to be profitable. It believes that this mark up will satisfy the company's profit obje..
What is richmond corporations total net cash flow : Richmond Corporation was founded 20 years ago by its president, Daniel Richmond. The company originally began as a mail-order company but has grown rapidly in recent years, in large part due to its Web site. Because of the wide geographical dispersio..

Reviews

Write a Review

Programming Languages Questions & Answers

  Write a program that will allow a user to enter in a

write a program that will allow a user to enter in a sentence of up to 100 characters. then take that sentence and

  Design a c# windows phone 8 application

Design and implement a C# Windows Phone 8 application based on the SoundBoard app in the Windows Phone 8 Development for Absolute Beginners textbook.

  Design program to accepts account number

Design a program that accepts an account number, the account owner's first and last names, and a balance. Print the projected running total balance for each year for the next 20 years.

  Card generator program by linked list

Address Book-Card Generator Program Using a Linked List. This program will have names and addresses saved in a linked list. In addition, a birthday and anniversary date will be saved with each record.

  How can you tell whether an exception is checked or

questionnbsp how can you tell whether an exception is checked or unchecked? what is required of checked exceptions

  Write program which will accept list of student-s name

Write a program which will accepts list of student's name, individual scores for quiz1, quiz2 and quiz3. Your program must then compute for average of 3 quizzes.

  Develop a functional web-based application for a calculator

Develop a functional web-based application for a calculator. It does not need to be live; you can provide JavaScript, CSS, and HTML files. The calculator should successfully complete addition, subtraction, multiplication, and division operations.

  Design architecture of system to accept natural language

Using the generic model of a language processing system presented here, design the architecture of a system that accepts natural language commands and translates.

  Program to store item-s price

Suppose a c++ program requires to store item's price. Price will range from $15.50 to $20. Write down assignment statement which allots value $16.23 to variable.

  Write program asks user to enter temperature

Write a program that asks the user to enter a temperature, and then shows all the substances that will freeze at that temperature and all the substances that will boil at that temperature.

  Create-implement program which creates exception

Create and implement a program which creates an exception class called StringTooLongException, designed to be thrown when string is discovered that has too many characters in it.

  Program to create professor rating class

Write down program to create Professor Rating class comprising of professor ID and three ratings. Three ratings are utilized to estimate easiness.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd