CSC72003 Programming II Assignment

Assignment Help Programming Languages
Reference no: EM132446544

CSC72003 - Programming II - Southern Cross University

Your task is to complete various exercises in BlueJ, using the Java language.

Part 1:

Set up your assignment

To set up your assignment you will need to do the following:
• Create a folder called username-A2. For example, mine would be nfrancis -A2.
• Copy the zuul-better project in chapter 8 of the book projects to your username-A2 folder.
• Create a word document called username-A2-documentation. For example, mine would be nfrancis-A2- documentation. Add your full name and student id to the footer. You will lose marks if you do not do this. Save this word document to your username-A2 folder.
After you have set up your assignment open the zuul-better project In BlueJ, create a new instance of the Game class, run the play method and familiarize yourself with the game.

Design your game

Using the given zuul game as a starting point, you must design your own game. In the tutorial, you can ask your tutor for advice.

If you find it difficult to visualize this sort of game scenario, try modelling your game on some familiar real-world location. If you need additional inspiration, you can try playing the original Colossal Cave Adventure game.

You must have the following in your game:
• Your game scenario must have at least ten (10) different rooms.

• Your game scenario must have at least six (6) types of exits - e.g., north, south, east, west, up, down and any others you require. This requirement does NOT mean that each room must have 6 exits.

• Your game scenario must include at least six (6) items that the player could find, pick up and potentially use.

• Your game must have some way for the player to win. Most likely, this will be by achieving some goal such as finding a particular item, surviving for some specified number of moves, or exiting a particular room - anything sensible for your game.

Documentation

Write a brief description of your game in your word document. You must:
• Describe your game including the back story and the setting
• List the items in the game
• Draw a map for your game scenario. You must:
o Label the rooms
o Label the exits (connections between rooms)
o Specify the locations of the items
• Explain how the player wins
The document must include the map (e.g., screenshot, picture).

Part 2:

Programming exercise 1

• Update the comments at the beginning of the Game class, the Room class and the message displayed by the printWelcome and printHelp method so that they describe your game.

• Update the Game and Room class so that it creates the rooms and exits that you invented for your game. You do not need to add any items to your game yet. You will add items later.

Programming exercise 2
Your game scenario requires that there be items positioned throughout the world that the player can pick up and possibly use. An item sounds like something that should be represented by an object! So create an Item class to represent the items in your game. You will need to decide what fields your Item class needs to have, what parameters the constructor will require and what methods the class will have. At a minimum, items will have a name and a description. However, items may have many other attributes that make sense for your game (e.g. weight, colour, value, destructive power ..)

Programming exercise 3

Now that there is a class for representing Items we need a way to allow the rooms to contain an item. Modify the Room class so that one item can be added to or removed from the room. You will need to think about what fields and methods to add to the Room class. Also, think about what the methods that you add should do when an attempt is made to add an item to a room that already contains an item, or an attempt is made to remove an item from a room that does not contain an item.

Programming exercise 4

Now that a room can contain an item, when the player enters a room he/she should be told about the item in that room (if there is one). Modify the appropriate code so that if the player enters a room containing an item, the name and description of the item are displayed along with the description of the room and the list of exits.

Programming exercise 5

Edit the code in the Game class so that the items for your game are created and added to the appropriate rooms at the start of the game. Recall that your game must include at least six items. Be sure to test any methods that you add or modify.
Play the game to ensure that your items are appearing in the rooms.

Part 3:

Now that rooms can contain items and a player will know when they enter a room with an item, it would be nice if the player could pick up and carry items. Add functionality to the Player class that will allow the player to pick up and drop items. The player should be able to carry any number (i.e. a collection) of items.

Programming exercise 6

Modify the Game class so that it will recognize the command take. When the user enters the "take" command, the item in the current room, if there is one, should be added to the items that the player is carrying, and a message should be printed indicating that the player has taken the item. If there is no item in the current room the take command should print an error message. Be sure to test any methods that you add or modify. (Hint: Remember that one task of the Game constructor is to "teach" the CommandReader what words are valid commands. Thus, you will need to make a change in Game's constructor if you want to introduce a new command.)

Programming exercise 7

Modify the Game class so that it will recognize the command inventory. When the user types "inventory" the game prints the names of the items that the player is currently carrying. You should think carefully about where the list of item names should be generated. (Consider the fact that the player is carrying the items and think about how the list of exits for a room is generated and displayed.)
Play the game to be sure the inventory command works!

Programming exercise 8
Add support to the game for a drop command so that the player can drop an item by name (e.g. "drop book"). The dropped item should appear in the current room. If the current room already contains an item, the drop command should print an error message indicating that the room is full and the player should continue to carry the item.
Play the game to be sure the drop command works!

Programming exercise 9
Implement at least two locked doors to your game. The player needs to find (or otherwise obtain) a key/item to open a door. You may incorporate the drop command or create a new "use" command to open the door. Adjust your winning condition if necessary.

Programming exercise 10
Notice that when you use the help command take, inventory and drop do not appear as command words. Modify the printHelp method of the Game class so that it automatically displays any new command words that are added to the game. Do not hard code the words in the printHelp method. Hint: you should modify the CommandWords class to do this.

Programming exercise 11
Add some form of time limit to your game. If a certain task is not completed in a specified time, the player loses. A time limit can easily be implemented by counting the number of moves or the number of entered commands. It does not have to be real-time.

Play the game to be sure the modified help command works - celebrate!

Attachment:- Programming.rar

Reference no: EM132446544

Questions Cloud

Research paper topic on terrorist strategy : What are the flaws of this strategy? Why? and What infrastructures support the use of this method as part of a terrorist strategy? How and Why?
Evaluate the business ethics and corporate social : Critically evaluate the business ethics and corporate social responsibility with their theoretical approaches of KLM airline
Prepare General Journal entry for March : A Company authorized a 10% stock dividend when the market value was $17 per share. Prepare General Journal entry for March 31
Conducting a benefit plan needs assessment : Please answer and include a source please. As part of conducting a benefit plan needs assessment, a human resource professional
CSC72003 Programming II Assignment : CSC72003 Programming II Assignment Help and Solution, Southern Cross University - Assessment Writing Service - Implement at least two locked doors to your game
Employer-sponsored benefits : Please answer this question. Please add a source if possible. Employer-sponsored benefits reflect the culture and business of the organization
Prepare the General Journal entry for August transaction : On August 1 2019 A Company reissued 700 shares of treasury stock at the going market rate of $18 per share. Prepare the General Journal entry for August
Why academic equity is important in classroom : Write an essay about why academic equity is important in classroom?Discuss whats the need for that and what are there impact
Make the General Journal entry for August : Annual interest rate implicit in the lease was 7% and the first lease payment of $1,700. Make the General Journal entry for August

Reviews

Write a Review

Programming Languages Questions & Answers

  Write a haskell program to calculates a balanced partition

Write a program in Haskell which calculates a balanced partition of N items where each item has a value between 0 and K such that the difference b/w the sum of the values of first partition,

  Create an application to run in the amazon ec2 service

In this project you will create an application to run in the Amazon EC2 service and you will also create a client that can run on local machine and access your application.

  Explain the process to develop a web page locally

Explain the process to develop a Web page locally

  Write functions

These 14 questions covers java class, Array, link list , generic class.

  Programming assignment

If the user wants to read the input from a file, then the output will also go into a different file . If the user wants to read the input interactively, then the output will go to the screen .

  Write a prolog program using swi proglog

Write a Prolog program using swi proglog

  Create a custom application using eclipse

Create a custom Application Using Eclipse Android Development

  Create a application using the mvc architecture

create a application using the MVC architecture. No scripting elements are allowed in JSP pages.

  Develops bespoke solutions for the rubber industry

Develops bespoke solutions for the rubber industry

  Design a program that models the worms behavior

Design a program that models the worm's behavior.

  Writing a class

Build a class for a type called Fraction

  Design a program that assigns seats on an airplane

Write a program that allows an instructor to keep a grade book and also design and implement a program that assigns seats on an airplane.

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