2D Adventure, Java assignment help

timer Asked: May 24th, 2016
account_balance_wallet $125

Question Description

You need to track a werewolf that is terrorizing a village surrounded by forest.

You will search the different areas of the forest for a werewolf that has been terrorizing the local village and attempt to subdue it by firing silver bullets at it from an adjacent area. Each action you take during the night brings dawn closer, and each time dawn breaks you will find another villager has been taken by the wolf. If all the villagers die/leave then you lose the game.

If you successfully shoot the werewolf three times then it will be subdued and you can capture it and you win the game. But shoot toward the village and you’ll lose a villager and possibly end the game. As you explore the forest, if you enter the same area as your target it will take flight and move to another area before you can take a shot, but not before biting you! While bitten you become much less aware of your surroundings. You can still shoot while bitten, but you can only be healed by finding your way back to the village (which you will be able to hear when in an adjacent area). Worse, if you enter the same area as your target while bitten then it will finish you off (i.e., you lose the game). Bitten or not, if you run out of bullets then the village cannot be saved and the game ends.

As long as you are not bitten you will have some idea of your location, the areas around you, and the nearness the wolf (because of its smell). You can always tell if you are adjacent to the village due to the noise of activity, even if you’ve been bitten.

The game supports three difficulty levels, which have the following characteristics:

EASY: Player begins in village area = yes, Villagers = 6, Silver bullets = 8, werewolf moves when shot = no

NORMAL: Player begins in village area = no, Villagers = 4, Silver bullets = 6, werewolf moves when shot = no

HARD: Player begins in village area = no, Villagers = 4, Silver bullets = 6, werewolf moves when shot = yes

Note: The werewolf should always move each new day.

The completed implementation will consist of five files, only 
one of which must be written by you (and submitted). These files are:
  • Adventure2D.java This is the driver program (with a main() method). The code of this is complete and it MUST NOT be changed. The code in this file is very simple: it declares and instantiates an object of theWereWolf class and calls its play() method.
  • GameWorld.java This is a library class and this file contains resources that you are to use in developing your implementation of the task. The code is complete and MUST NOT be changed.
  • Result.java This is an enumerated type (another library class) that lists the possible outcomes from different actions the user can take. The code is complete and MUST NOT be changed.
  • Difficulty.java This is an enumerated type (also another library class) that lists the possible difficulty levels of the game. Each value of this type can report details about aspects of the game’s difficulty, such as the number of silver bullets the player starts with.
  • WereWolf.java This is an organiser class and is the file that you are to write; the starting files (link is below) contain a ‘skeleton’ version of this code that you should use as a starting point.
    • There will be no main() method in the class, it will contain methods that organise the task. This will include all the interactions with the user.
    • You should make sure that you do the following:
      • Create and use an object of the GameWorld class. You must not write code in WereWolf.javathat duplicates things that could be done using methods of the GameWorld class.
      • Use the trace() method (provided in the skeleton) to include tracing messages in your program (switch the messages off before submission).
      • Use separate methods to implement the separate activities within the task.
      • Use instance variables to store data that is used or changed by more than one method and/or needs to persist for the life of the object.
      • Use local variables to store the data that is used by just one method.

Unformatted Attachment Preview

EXTRA INFORMATION: Write code in WereWolf.java to do the following: �Housekeeping� tasks in WereWolf() Instantiate objects of the GameWorld and Scanner classes. Switch on the debugging/tracing messages in the WereWolf and GameWorld classes. (Switch them off before you submit your program for assessment.) Introduction in explain() Provide the user with a general explanation of the game. Play the game: after the user selects the difficulty of the game (easy, normal or hard), they should be presented with a description of what that level of difficulty entails, and then the game begins with the village and werewolf randomly located somewhere in the forest. The user is prompted to make �moves� until the game is over. The game will end when any one of the following happens: The user tries to move to the area occupied by the werewolf when they are already bitten. The user runs out of bullets. The number of villagers drops to zero, which can happen when dawn comes and another villager is lost, or when the user shoots towards the village when its population was only 1. The user shoots into the area containing the werewolf three times. The user chooses to quit the game. Before each move the user is provided with information. They are always told the following: The number of actions left until dawn. The current village population. And, if they can hear the sounds of the village, that it is nearby. If they are not currently bitten they are also told: The player�s current location (area number) in the forest. The numbers of the four connecting areas. The number of times they have successfully shot the werewolf and the number of remaining bullets. Any available information about the location of the werewolf, i.e., if the player can smell it in an adjacent area. The user is asked what they want to do for this turn. The options are: Walk into another area (by number). The player will be asked to enter the number of the area they want to walk into. If the area is not connected to their current location they will not be able to walk, and should be told so. Otherwise if the area is connected to their current location, they will enter the new area and: if the new area doesn�t contain the werewolf or the village the game will continue. if the new area contains the village then they are told they have found the village; any bites are healed; the game continues. if the new area contains the werewolf and the player was already bitten then the game is over (because they cannot survive two bites from the beast), otherwise they receive one bite and must, over subsequent turns, find their way back to the village to be healed. Shoot into another area (by number). The player will be asked to enter the number of the area they want to shot into. If the area is not connected to their current location, they will be told this. If the area is connected and: contains the werewolf, then it is noted that they have successfully hit the target and the game continues. When this occurs three times, the beast is subdued and the game ends. contains the village, then a villager dies. If it was the last villager then the game is over. is empty, then it is noted that they�ve missed. After walking or shooting into a connected area the game should check if dawn has arrived and notify the player if it has. If the number of villagers is now zero then the game ends. Reset the game. If this option is chosen then many game parameters are reset: the player�s position is changed. the werewolf�s position is altered. the village�s location is changed and its population is restored to its original value. the player is free from bites. the shooting tally is reset to 0 and the amount of ammunition is full again. the game difficulty remains unchanged. Quit the game. The game will end. Note that while GameWorld keeps track of most of the game�s state, it doesn�t keep track of everything, so you will need to work out what additional variables WereWolfenstein2D requires. ...
Purchase answer to see full attachment

Tutor Answer

School: Carnegie Mellon University

I am attaching the comple...

flag Report DMCA

Goes above and beyond expectations !

Similar Questions
Hot Questions
Related Tags
Study Guides

Brown University

1271 Tutors

California Institute of Technology

2131 Tutors

Carnegie Mellon University

982 Tutors

Columbia University

1256 Tutors

Dartmouth University

2113 Tutors

Emory University

2279 Tutors

Harvard University

599 Tutors

Massachusetts Institute of Technology

2319 Tutors

New York University

1645 Tutors

Notre Dam University

1911 Tutors

Oklahoma University

2122 Tutors

Pennsylvania State University

932 Tutors

Princeton University

1211 Tutors

Stanford University

983 Tutors

University of California

1282 Tutors

Oxford University

123 Tutors

Yale University

2325 Tutors