Assignment 2 – Text Based Game
For each class refer to its corresponding test to verify field and method naminconventions.
- Although there are many ways to construct an application, you are required tadhere to the rules stipulated below (to achieve marks).
- If variable names are not stipulated, you can use your own names for variables.his shows that you have written the application (we will check for plagiarism).
- For Assignment 2 you MAY import additional Java packages in your project, butonly those that are part of the standard Java library (e.g., java.util, java.io, etc.).Using third-party libraries or packages not included with the standard JDK isNOT permitted.
- Do NOT change or modify files included in the "test", "lib" or "out" folders.
- Do NOT modify the template code. However, you are allowed to create your owmethods or classes if they are needed.
- You MUST complete this assignment independently – Do NOT discuss or shareyour code with others, and Do NOT use ChatGPT! Any cheating behaviour willresult in a zero score for this module and will be subject to punishment by thUniversity.It is *STRONGLY ADVISED AGAINST* utilizing any translation software (suchasGoogle Translate) for the translation of this document.The jUnit tests included in the skeleton code are basic and only scratch the surfacein evaluating your code. Passing these tests does not guarantee a full mark.Wrong filestructure leads to a substantial penalty. Make sure you have followedMake sure you have pushed the version of your code that you want marked togitlab.
- Make sure you keep your video recording to the time limit. Any videos longerthat 7 minutes will be penalised and videos over 10 minutes will receive zero. DONOT compress your video in SIZE or TIME.
- Late submissions are accepted only for 24 hours after the deadline and are penalised at 5% of the final assessment mark.3IMPORTANT READ THIS FIRST:
1 Process For Assignment 2 Make sure you follow the process as outlined below. Assignment 2 has a differentstructure and a somewhat different approach to Assignment 1:Clone the repo for assignment 2. (If you haven’t yet accessed gitlab.cs.bham.ac.ukdo so ASAP.)
- Download and unzip the docs.zip JavaDoc file to your own device. In the rootfolder open the IndexAll.html file. Read through all the package, class, methodand field definitions and descriptions.Complete each class in the src folder as defined in the docs.
- The suggested order for completing classes is:(a) All classes in org.uob.a2.gameobjects.
(b) All classes in org.uob.a2.commands.(c) All classes in org.uob.a2.parser.(d) All classes in org.uob.a2.utils.(e) The Game.java class.For each class(a) Complete the required code (methods and attributes).
(b) Run your code using the run.sh command, ensuring it compiles withouterrors.
(c) Test your code using the test.sh command. You will have errors at firstbut they should hopefully decrease as you progress.
(d) git add, git commit, and git push your code.
- Keeping testing after each class is implemented until everything is working.
- Add the required new features:
(a) Display a map.(b) Adding a score. You can decide on the rules for how the scoring works butyou need to clearly explain it in the video and game.c) Combining items.
42 Introduction
In this assignment, you are tasked with updating the Zork style text based game fromAssignment 1(https://en.wikipedia.org/wiki/Zork). Please note that it is likely that youwill need to start from scratch due to the redesign of the game, but you ARE allowed toreuse your story and and puzzles from Assignment 1.The game is played by the user entering in various commands (e.g. "move south",代写Text Based Game "look room", "get key", "use key on chest"), to which the game responds with text basedoutput (e.g. "You pick up the rusty key").
3 Mark allocations
You will receive marks based on two aspects of the game: Firstly, the results of running the test.sh command. We will run our own version of these tests once you havesubmitted. This command will test each class and method (detailed as in the provideddocs.zip and in Tasks 1 - 6). You need to implement all the classes and methods asdescribed in the docs as well as any required for your new features.Secondly, you will need to submit a screen recording showing you playing the gamend discussing the code. Your screen recording needs to have the following:Show yourface and your student card.Play through the game once showing all the rooms, puzzles and an example ofeach of the expected commands.
- Show and briefly explain the code in your Game.java file.
- Show and briefly explain your required new features.
- Show and briefly explain anything else that you did beyond the normal scope ofthe assignment. This includes any additional features you’ve added.The screen recording must be shorter than 7 minutes. You can use a text-to-speech
app if you do not want to record your own voice.
3.1 Minimum expected commands
The following is a complete list of commands the game must be able to parse (valuesin angle brackets refer to arguments given to a command, the pipe symbol referstodifferent options):move <exit name>: Move to a different location as defined by an exit’s name(e.g., ’move north’).
- look <room|exit|features>|<item name>|<equipment name>|<featurename>: Look around the current room, at an exit, at a feature, or, at a specific item,equipemnt or feature.5• get <item name|equipment name>: Pick up an item orequipment from thecurrent room (e.g., ’get key’).drop <item name|equipment name>: Drop an item or equipment from yourinventory (e.g., ’drop key’).
- use <equipment name> on|with <feature|item>: Use an item in your inventory on its own, or on a feature or item (e.g., ’use lamp’ or ’use key on chest’)status <inventory|player|item name|equipment name|map|score>: Checkyour current status, or inventory; or get more information about a specific item orequipmentin your inventory.(e.g. ’status player’, ’status inventory’, ’status key).Also able to display the map and your score.
- help <topic>: Display this help information or get help on a specific topic (e.g.,help move’ or ’help’).ombine <item1> and <item2>: Combine two items into a new item or equipment. (e.g., ’combine stick and rock’ or ’combine egg andlour’).
- quit: Exit the game.NOTE: Some of these commands are not included in the template code and need to be added i.e. combine, status map, status score
3.2 Minimum game requirements The following are the minimum requirements for the game. You are welcome to addmore if you want to:
- At least ten (10) unique rooms or areas.
- At least two (2) features/chests.
- At least four (4) items.
- At least two (2) pieces of equipment.
64 Full class hierarchy org.uob.a2
- Gameorg.uob.a2.commands Command (abstract)-
5 Task 1 - org.uob.a2.gameobjectsThese classes represent all the game objects (i.e. Map, Item etc.) that will be used inthe game. The GameState class contains the current state of the game. The Containerclass represents anything that can "contain" another object. This is implemented asanother hidden equipment or item in the room which is then revealed when the containeris "opened". Usable is an interface that makes GameObjects usable by enforcing access7to a GameObjects UseInformation attribute.
6 Task 2 - org.uob.a2.commandsThese classes represent all the commands that the player can execute in the game andthat are generated from the parser package. Commands work on the object name, notthe id. This package also includes an enum of all CommandTypes and an Exception.
7 Task 3 - org.uob.a2.parser
These classes convert the player’s text into into Commands that can be executed by thegame. It firstly sanitises the players input to get it into a correct format. Then it convertit into Tokens using the tokenise method and finally it parses these Tokens use the parsemethod.
8 Task 4 - org.uob.a2.utils
These classes read in a text file (as stored in the data directory) into a GameStateObject.An example of the file is shown below and also included in the data directory:player:pietermap:m1room:r1,test room,This is a test room for testing. It is bland.,false,
标签:code,Based,Text,game,uob,Game,classes,org,your From: https://www.cnblogs.com/CSE2425/p/18598983