Create a new instance of the game class

Assignment Help JAVA Programming
Reference no: EM132631309

Part 1:

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.

You should also:

• Review the code style guide in topic 7 as this is the style you will be required to use in your assignment.

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 two (2) items in each room that the player could find, pick up and potentially use.
• The player can only carry maximum five (5) items in the player's inventory.
• 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 and how to use it
• 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 in the map
• 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 items 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 (unless you have taken the item). 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 two items per room. 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 first door/entrance door should be locked and for the second one, you may choose any other doors. The player needs to find (or otherwise obtain) a key/item to open a door. You will need to create a new "use" command to open the door. Hint: Reuse the take command to implement the use command. Adjust your winning condition if necessary.

Programming exercise 10
Modify the printHelp method of the Game class so that it also prints the status of the current room and make sure to include helpful messages to the players.

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:- JAVA_Assignment.rar

Reference no: EM132631309

Questions Cloud

Population mean a confidence interval extending : Based on these sample results, a statistician found for the population mean a confidence interval extending
Why do financial companies have to abide by guidelines : In 80 words or more review and discuss the Sarbanes-Oxley Act (SOX) and why do financial companies have to abide by these guidelines.
Prepare statement of operations and financial position : The PPE were purchased by the home office for the branch and are recorded in the books of the branch. Prepare statement of operations and financial position
Discuss the importance of preprocessing the datasets : Discuss the importance of preprocessing the datasets to ensure better data quality for data mining techniques. Give an example from your own personal experience
Create a new instance of the game class : Create a new instance of the Game class, run the play method and familiarize yourself with the game - game scenario must have at least six (6) types of exits
Observations of the housing market : Would the demand and supply increase, decrease or remain the same?
Why are the original-raw data not readily usable : Why are the original/raw data not readily usable by analytics tasks? What are the main data preprocessing steps? List and explain their importance in analytics.
Distinguish between forward and reverse auctions : a. Compare Wal-Mart.com with Amazon.com. What features do the sites have in common? Which are unique to Wal-Mart? To Amazon.com?
By how much shareholders contributed capital change : They also had a net income of $40000 and paid dividends of $8000. By how much if any, did their shareholders contributed capital change

Reviews

Write a Review

JAVA Programming Questions & Answers

  Write a console application in the java programming

Take advantage of object-oriented concepts such as composition, inheritance, method overriding, abstract classes, interfaces wherever appropriate.

  These are more specialized versions of the pizzaorders you

your pizza shop expands and now handles delivery orders and sit down orders in a restaurant setting. there are

  Implement the draw program in javafx

Implement the Draw program in JAVAFX. Your program must have the following minimum capabilities. ColorChooser to choose colors.

  Determine the number of tribble for any hour

Write a JAVA program that uses recursion to determine the number of tribble for any hour. It should prompt the user for the hour and then display the total.

  Implement a java solution to towers of hanoi problem

Recursively implement a java solution to towers of hanoi problem so that the stepwise states of the towers

  Using an array in java

Using an array in Java - have a list of keywords from a web service and have to print out the list of keywords on the screen with one keyword on each line. This is my code

  Create a class called month with the given fields and method

Create a class called Month (java file called Month.java) with the (exact) following fields and methods. Create three objects: Month1 one using the first constructor (with no arguments) and Month2.

  Identify classes for the developed system

Identify classes for the developed system. Include all the attributes and its data type and Produce a complete class diagram using UML notations

  Simulate a good old game of rock paper and scissors

You are to complete the code found in Player.java. Once completed you can then simulate a good old game of Rock, Paper, Scissors. To play you need to compile Player.java, InputMaker.java, and RockPaperScissorsTest.java.

  Website that utilizes drag-and-drop or web sockets

A website that utilizes drag-and-drop or web sockets. Review the website source, and evaluate how the author created the pages

  Write a java application that calculates and displays

The application should ask the user to enter the name of the property owner and the assessed value of the property for each owner (total N owners) and calculate the property tax.

  Eax contains the given contents before the instruction

For each add instruction in this problem, assume that EAX contains the given contents before the instruction is executed, and give the contents of EAX as well as the values of the CF, OF, SF, and ZF flags after the instruction is executed:

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