here are all the supporting documents for the assignment.i want 2 copies.

1 answer below »
here are all the supporting documents for the assignment.i want 2 copies.
Answered Same DaySep 22, 2021ITECH7201

Answer To: here are all the supporting documents for the assignment.i want 2 copies.

Neha answered on Sep 29 2021
138 Votes
44927/49927.docx
ITECH7201 Software Engineering: Analysis and Design Assignment 2
        
        
        
        
        
        
        
        
        
Maze Game
ITECH7201 Software Engineering: Analysis and Design Assignment 2
Table of Contents
1 Introduction     3
2. Statement of contribution     3
3. Group part – Maze Game map    4
4. Group part – Environment introduce    4
5. Group part – Move/Look command    4
5.1 Move command     4
5.2 Look command     5
6. Group part – List/Get/Drop item command    6
6.1 List command     6
6.2 Get command     6
6.3 Drop command    
7
7. Group part – Buy/Sell item command    8
7.1 Buy command     8
7.2 Sell command     9
8. Group part – Attack/Potion command 10
8.1 Attack command     10
8.2 Potion command     11
9. Group part – Unit tests     12
10. Individual part – User stories 16
11. Individual part – Class diagrams for Lab 7 & 8 17
11.1 Lab 7 Class Diagram     17
11.2 Lab 8 Class Diagram     18
12. Individual part – Sequence diagrams 19
12.1 Sequence Diagram for “?” command 19
12.2 Sequence Diagram for “?” command    20
13. Individual part – Punchtime report    21
1 Introduction
This report is to document the analysis and design for the assignment of ITECH 7201: Design and Analysis. The motive of the assignment is to learn java code by modifying the given code for a Maze Game and learn to develop more functions in it.
This assignment consists of two parts: Group and individual part.
Customized map, game environment and various commands are the part of the group task.
Class diagram for lab 7 and 8, sequence diagram for two item management, punchtime report and user stories of deliverables are the tasks to be done individually.
3. Group part – Maze Game map
The following picture is the maze game map.
Maze Game Map
4. Group part – Environment introduce
The maze game is developed in java language and the output can be checked on the java console screen. The code will not execute anything until the user enters the command. The program allows the user to move to different locations, NPC located, look items, get item from to the dropping items, list items, buy item from or sell item to a shop, attack NPC if hostile NPC stays at the location, use potion to restore life points.
There are 7 locations in this game (as shown above), 5 normal locations, including 1 start-up location, 2 special locations which are shops. In the normal locations, there are gold pieces; in the shop locations, nothing is placed.
As the game starts the player will be standing at the starting point. Initial status of the play is: strength (10), agility (10), life point (30), gold (20), 3 potions.
5. Group part – Move/Look command
5.1 Move command
The format of move command is: move/go [direction]
As the name given if the user wants to move from one place to another then he needs to enter this command and the location of the user will be changed. The game will take the user from current location to a new location and every important information will be displayed there. But in case if the user chooses a location which does not have an exit then he will stay at the same location and an error message will be shown to him without changing his location.
Source code:
package mazegame.control;
import mazegame.entity.Exit;
import mazegame.entity.Player;
public class MoveCommand implements Command {
public CommandResponse execute (ParsedInput userInput, Player thePlayer) {
if (userInput.getArguments().size() == 0) {
return new CommandResponse ("If you want to move you need to tell me where.");
}
String exitLabel = (String) userInput.getArguments().get(0);
Exit desiredExit = thePlayer.getCurrentLocation().getExitCollection().getExit(exitLabel);
if (desiredExit == null) {
return new CommandResponse("There is no exit there . . . try moving somewhere else!");
}
thePlayer.setCurrentLocation(desiredExit.getDestination());
return new CommandResponse("You successfully move " + exitLabel + " and find yourself looking at " + thePlayer.getCurrentLocation().getDescription() + "\n\n" + thePlayer.getCurrentLocation().toString());
}
}
5.2 Look command
The format of look command is: look or look [direction]
“look” means look current location, “look [direction]” means look specific location that was entered.
This look command is very useful to the user. If user gives the look command to the program then output screen will display everything to the user without changing the location of the user.
Source code:
package mazegame.control;
import mazegame.entity.Exit;
import mazegame.entity.Player;
public class LookCommand implements Command {

private CommandResponse response;

public CommandResponse execute(ParsedInput userInput, Player thePlayer) {
response = new CommandResponse("Can't find that to look at here!");
if(userInput.getArguments().size() == 0) {
response.setMessage(thePlayer.getCurrentLocation().toString());
return response;
}
for (Object argument: userInput.getArguments()) {
if (thePlayer.getCurrentLocation().getExitCollection().containsExit(argument.toString())) {
Exit theExit = thePlayer.getCurrentLocation().getExitCollection().getExit((String)argument);
return new CommandResponse(theExit.getDescription());
}
}
return response;
}
}
6. Group part – List/Get/Drop item command
6.1 List command
The format of list command is: list
List command is used to know what all the player has with him to survive in the game.
Source code:
package mazegame.control;
import mazegame.entity.Player;
/**
* Created by sola2 on 30/05/2017.
*/
public class ListCommand implements Command {
@Override
public CommandResponse execute(ParsedInput userInput, Player thePlayer) {
return new CommandResponse(thePlayer.getInventory().toString());
}
}
6.2 Get command
The format of get command is: get [item]/gold
The user can use the get [item] command to get anything from the existing location if the item is available. If the system finds the item at the given location then it will be added to the player’s inventory and removed from the location.
Source code:
package mazegame.control;
import mazegame.entity.Item;
import mazegame.entity.Player;
/**
* Created by sola2 on 31/05/2017.
*/
public class GetCommand implements Command {
@Override
public CommandResponse execute(ParsedInput userInput, Player thePlayer) {
String itemLabel = userInput.getFirstArg();
if (userInput.getArguments().size() == 0){
return new CommandResponse("What do you want to get?");
}
//get gold command
int gp = thePlayer.getCurrentLocation().getInventory().getGold();
if (itemLabel.equals("gold")){
if (gp == 0){
return new CommandResponse("There is no gold here...");
}
else{
thePlayer.getInventory().addMoney(gp);
thePlayer.getCurrentLocation().getInventory().removeMoney(gp);
return new CommandResponse("You got " + gp + " pieces of gold!");
}
}
//get items command
//find if there's the item which inputted by the user
Item itemOnLocation = thePlayer.getCurrentLocation().getInventory().findItem(itemLabel);
if (itemOnLocation == null){
return new CommandResponse("There is no " + itemLabel + " at this place...");
}
//successfully added
boolean successAdd = thePlayer.getInventory().addItem(itemOnLocation);
if (successAdd){
thePlayer.getCurrentLocation().getInventory().removeItem(itemLabel);
return new CommandResponse("You picked up a " + itemLabel);
}
//failed to add
return new...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here