Software Engineering ITECH7201: Implementing Commands in the Maze Game
VerifiedAdded on 2022/11/15
|11
|2137
|121
Practical Assignment
AI Summary
This document provides a detailed solution for a Software Engineering assignment centered around the development of a text-based adventure game, the Maze Game, with a focus on implementing command handling and player movement. The assignment covers several key aspects, including cre...

Software
Engineering
Engineering
Paraphrase This Document
Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser

Contents
Functionalities Discussed in Lab 7..................................................................................................1
Incorporating Command handling in the DungeonMaster class..................................................2
Implementing the Move Player command...................................................................................2
Program execution...........................................................................................................................3
Implementation of features..............................................................................................................4
Unit test............................................................................................................................................5
User stories......................................................................................................................................6
Class diagram...................................................................................................................................7
Sequence diagram............................................................................................................................8
Contribution.....................................................................................................................................8
References........................................................................................................................................9
1
Functionalities Discussed in Lab 7..................................................................................................1
Incorporating Command handling in the DungeonMaster class..................................................2
Implementing the Move Player command...................................................................................2
Program execution...........................................................................................................................3
Implementation of features..............................................................................................................4
Unit test............................................................................................................................................5
User stories......................................................................................................................................6
Class diagram...................................................................................................................................7
Sequence diagram............................................................................................................................8
Contribution.....................................................................................................................................8
References........................................................................................................................................9
1

Functionalities Discussed in Lab 7
Creating a command parser
Before we are able to start on implementing the commands and adding additional
functionality to the Maze Game, we have to establish the way of breaking apart the user input.
Commands look like command <argument(s)> i.e.: move westSo what we want to try and do is
cut up our user input from one string into variety of words, and calculate that area unit
commands and that area unit arguments. We can assume that the primary word encountered in
user input is that the command, and what follows area unit the argument(s). We tend to may even
create our own command computer program more user friendly by dropping off usually used
words that area unit neither commands nor helpful arguments (Buzdin & Nikiforova, 2012). ie: if
the user writes “go to the north” we should drop to and the. Let’s begin by making a category
that represents our input once it's been parsed into command + arguments. Produce a brand-new
category within the Control package known as ParsedInput.
Create a Parser category within the same package
Now generate a category which may analyze our user input, provided it's given an
inventory of commands once it gets created.
Incorporating Command handling in the DungeonMaster class
Incorporating Command handling within the Dungeon Master category
Ok, so now that the parser is configured, we would like to start using it. However, before
doing this we would like to create a tiny low amendment to our computer program to
accommodate retrieving a command from the user. A possibility is to use GetReply for the aim
of retrieving commands from the user. However preferably a good strategy would be to actually
design a method to query multiple players in a matter. Therefore, we would like to introduce a
retrieve technique specifically to capture player commands. Once our client is setup to retrieve
2
Creating a command parser
Before we are able to start on implementing the commands and adding additional
functionality to the Maze Game, we have to establish the way of breaking apart the user input.
Commands look like command <argument(s)> i.e.: move westSo what we want to try and do is
cut up our user input from one string into variety of words, and calculate that area unit
commands and that area unit arguments. We can assume that the primary word encountered in
user input is that the command, and what follows area unit the argument(s). We tend to may even
create our own command computer program more user friendly by dropping off usually used
words that area unit neither commands nor helpful arguments (Buzdin & Nikiforova, 2012). ie: if
the user writes “go to the north” we should drop to and the. Let’s begin by making a category
that represents our input once it's been parsed into command + arguments. Produce a brand-new
category within the Control package known as ParsedInput.
Create a Parser category within the same package
Now generate a category which may analyze our user input, provided it's given an
inventory of commands once it gets created.
Incorporating Command handling in the DungeonMaster class
Incorporating Command handling within the Dungeon Master category
Ok, so now that the parser is configured, we would like to start using it. However, before
doing this we would like to create a tiny low amendment to our computer program to
accommodate retrieving a command from the user. A possibility is to use GetReply for the aim
of retrieving commands from the user. However preferably a good strategy would be to actually
design a method to query multiple players in a matter. Therefore, we would like to introduce a
retrieve technique specifically to capture player commands. Once our client is setup to retrieve
2
⊘ This is a preview!⊘
Do you want full access?
Subscribe today to unlock all pages.

Trusted by 1+ million students worldwide

commands from the user we are able to modify DungeonMaster. Therefore, our game will
currently interpret commands, however aside from quit command it doesn’t do anything.
Moreover, our DungeonMaster category is commencing to get terribly untidy and will need
refactoring (Cardoso, Sousa & Barata, 2017).
Implementing the Move Player command
Implementing the Move Player command
Our RAD describes a Move Party User Story:
Move Party - players specify where they want their party to shift. If associated offered
exit exists within the mentioned direction, the system updates the player's location and
returns an outline of the new location
At this stage we've determined keep parties out and to rewrite the user story as:
Move Player - players specify the direction they want to shift. If associate offered exit
exists the mentioned direction, the system updates the player's location and returns an
outline of the new location
By modifying the SetupPlayer technique in DungeonMaster we want also to alter next the
Location category thus we are able to retrieve associated Exit. Since the Location command is
setup to retrieve the associated Exit we are now able to amend the DungeonMaster category to
accommodate player movement. Amend the ProcessPlayerTurn and implement a brand new
technique referred to as processMove in DungeonMaster.
Run the game and sort “move west” to verify the result. At this time we have enforced
player movement however it is not yet confirmed (Clingman, Kendall & Mesdaghi, 2004). You
may wish to admit however this can be improved from a usability perspective with some play
testing (for example making a ToString technique in Location as well as each the name of the
placement and also the Description then printing that to the user can be higher than simply the
3
currently interpret commands, however aside from quit command it doesn’t do anything.
Moreover, our DungeonMaster category is commencing to get terribly untidy and will need
refactoring (Cardoso, Sousa & Barata, 2017).
Implementing the Move Player command
Implementing the Move Player command
Our RAD describes a Move Party User Story:
Move Party - players specify where they want their party to shift. If associated offered
exit exists within the mentioned direction, the system updates the player's location and
returns an outline of the new location
At this stage we've determined keep parties out and to rewrite the user story as:
Move Player - players specify the direction they want to shift. If associate offered exit
exists the mentioned direction, the system updates the player's location and returns an
outline of the new location
By modifying the SetupPlayer technique in DungeonMaster we want also to alter next the
Location category thus we are able to retrieve associated Exit. Since the Location command is
setup to retrieve the associated Exit we are now able to amend the DungeonMaster category to
accommodate player movement. Amend the ProcessPlayerTurn and implement a brand new
technique referred to as processMove in DungeonMaster.
Run the game and sort “move west” to verify the result. At this time we have enforced
player movement however it is not yet confirmed (Clingman, Kendall & Mesdaghi, 2004). You
may wish to admit however this can be improved from a usability perspective with some play
testing (for example making a ToString technique in Location as well as each the name of the
placement and also the Description then printing that to the user can be higher than simply the
3
Paraphrase This Document
Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser

placement description alone). However this is often left as an additional nonmandatory exercise
for you.
Program execution
Generating the Maze Mesh
Once maze layer is properly generated we can then proceed with building the mesh based
on the collected data.
Our new mesh generation logic will be incorporated in the new script let’s call him Maze
Mesh Generator. This new script, exactly like the existing Maze Data Generator already
encapsulated in program logic, will be used by the Maze Constructor to build step by step the
maze.
The initial step will be to generate sample structure and then modify the script so that
entire maze will be generated. Some minor adjustments will be required to be done in the Unity
before modifying the code (Horstmann, 2010).
Materials that will be used with the mesh will be linked from the Project window in the
Graphic folder. Controller will be ranked higher Hierarchy window so that it’s Maze Constructor
will be seen by the Inspector.
A new tag called Generated will be added to the inspector from the Tag / Add Tag menu.
Generated tag will be later used when generating the mesh
Materials that will be used will be dragged from Graphics over the materials tag in the
Maze Constructor. The floor mat will be used for the Material 1 and the wall mat for Material 2.
4
for you.
Program execution
Generating the Maze Mesh
Once maze layer is properly generated we can then proceed with building the mesh based
on the collected data.
Our new mesh generation logic will be incorporated in the new script let’s call him Maze
Mesh Generator. This new script, exactly like the existing Maze Data Generator already
encapsulated in program logic, will be used by the Maze Constructor to build step by step the
maze.
The initial step will be to generate sample structure and then modify the script so that
entire maze will be generated. Some minor adjustments will be required to be done in the Unity
before modifying the code (Horstmann, 2010).
Materials that will be used with the mesh will be linked from the Project window in the
Graphic folder. Controller will be ranked higher Hierarchy window so that it’s Maze Constructor
will be seen by the Inspector.
A new tag called Generated will be added to the inspector from the Tag / Add Tag menu.
Generated tag will be later used when generating the mesh
Materials that will be used will be dragged from Graphics over the materials tag in the
Maze Constructor. The floor mat will be used for the Material 1 and the wall mat for Material 2.
4

Implementation of features
Implementation using a recursive algorithmic strategy
After you select your start line, pass that info to the algorithmic methodology (Yoo & Oh,
2017). Within the algorithmic methodology, you'll do the subsequent
Generate associate array with 4 random numbers to represent directions.
Begin for loop to travel for 4 times.
Identify a switch statement to take care of the 4 directions.
For that direction, check if the new cell are going to be out of maze or if it’s an open path
when you don’t have to do anything (Markham, 2014).
If the cell is a wall, set that cell to path and take a decision to pass the new current row
and column.
Building Mazes
Maze creation remains a complex and very advanced process. Specifically, it's difficult to
avoid mistakes if the structural rules don't seem to be implemented in a proper manner. 2a) Now,
use the pattern Builder to cover the complexness of the creation of the rooms (createMaze). Plan
a builder for the first game and additionally for the extension. Draw a changed UML category
diagram and notice the implementation.
Creation in Parallel Hierarchies
The model will be checked out from many different views. These views may look into
different diagrams showing different components of the model, but they can also may be
different based on the selection of manipulation they provide. Most significantly, there'll be read-
only views and changeable views (McAffer, Lemieux & Aniszczyk, 2010). A class model for
sophisticated diagrams, state charts, and activity diagrams has to be developed. It has to contain
category hierarchies for a few of the diagram elements like categories and their inheritance
arrows, states and their state transition arrows, activities and their activity transition arrows.
5
Implementation using a recursive algorithmic strategy
After you select your start line, pass that info to the algorithmic methodology (Yoo & Oh,
2017). Within the algorithmic methodology, you'll do the subsequent
Generate associate array with 4 random numbers to represent directions.
Begin for loop to travel for 4 times.
Identify a switch statement to take care of the 4 directions.
For that direction, check if the new cell are going to be out of maze or if it’s an open path
when you don’t have to do anything (Markham, 2014).
If the cell is a wall, set that cell to path and take a decision to pass the new current row
and column.
Building Mazes
Maze creation remains a complex and very advanced process. Specifically, it's difficult to
avoid mistakes if the structural rules don't seem to be implemented in a proper manner. 2a) Now,
use the pattern Builder to cover the complexness of the creation of the rooms (createMaze). Plan
a builder for the first game and additionally for the extension. Draw a changed UML category
diagram and notice the implementation.
Creation in Parallel Hierarchies
The model will be checked out from many different views. These views may look into
different diagrams showing different components of the model, but they can also may be
different based on the selection of manipulation they provide. Most significantly, there'll be read-
only views and changeable views (McAffer, Lemieux & Aniszczyk, 2010). A class model for
sophisticated diagrams, state charts, and activity diagrams has to be developed. It has to contain
category hierarchies for a few of the diagram elements like categories and their inheritance
arrows, states and their state transition arrows, activities and their activity transition arrows.
5
⊘ This is a preview!⊘
Do you want full access?
Subscribe today to unlock all pages.

Trusted by 1+ million students worldwide

Interpretative factory
Design the associate interpretative factory for GUI widgets (WANG, WANG & LIU,
2009). It will use 2 string parameters to see the category to instantiate: one parameter will be the
instance variable and other one will be used in creating the widget
Unit test
In all software and game development, process testing process plays a significant role.
The testing process is carried out to ensure the proper functionality of the developed game (Tan,
Teo, Chin & Anthony, 2013). Here the conducted testing method is known as unit testing. Here
the developed code thoroughly checked to identify the errors on it. The testing process includes
the testing of all the paths while the program execution.
User stories
User stories are collected from the users. It describes the preferred features by the users.
There are a number of requirements are identified from the user stories. Here some of the user
stories are described (Stemkoski, n.d.).
• Users require feature for pickup items and drop items.
• They also look for the feature to list the available items on their inventory.
• They also expect the location viewing feature.
• They also expect the feature to buy and sell the items.
• Also, they want to enter into the room and exit to the room.
6
Design the associate interpretative factory for GUI widgets (WANG, WANG & LIU,
2009). It will use 2 string parameters to see the category to instantiate: one parameter will be the
instance variable and other one will be used in creating the widget
Unit test
In all software and game development, process testing process plays a significant role.
The testing process is carried out to ensure the proper functionality of the developed game (Tan,
Teo, Chin & Anthony, 2013). Here the conducted testing method is known as unit testing. Here
the developed code thoroughly checked to identify the errors on it. The testing process includes
the testing of all the paths while the program execution.
User stories
User stories are collected from the users. It describes the preferred features by the users.
There are a number of requirements are identified from the user stories. Here some of the user
stories are described (Stemkoski, n.d.).
• Users require feature for pickup items and drop items.
• They also look for the feature to list the available items on their inventory.
• They also expect the location viewing feature.
• They also expect the feature to buy and sell the items.
• Also, they want to enter into the room and exit to the room.
6
Paraphrase This Document
Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser

Class diagram
Class diagram for lab 7
There are four classes are used in lab 7 such as the parser, parsed input, location, and
dungeon master. The location class has three attributes. These are used to store the values. It also
has three methods such as location, set description and set label (Meiliana, Septian, Alianto,
Daniel & Gaol, 2017).
7
Class diagram for lab 7
There are four classes are used in lab 7 such as the parser, parsed input, location, and
dungeon master. The location class has three attributes. These are used to store the values. It also
has three methods such as location, set description and set label (Meiliana, Septian, Alianto,
Daniel & Gaol, 2017).
7

Sequence diagram
The picture shows the sequence diagram for item management. There are seven
sequences are involved in this diagram. There are 5 locations and two shops are described. The
player walks each and every shop and locations (Morelli, 2003). Then if the player wants the
item they can purchase the item. Otherwise, ignore the item.
Contribution
This is a group activity. Our team has two members including me. In the project, major
tasks are done individually by me and my friend. Initial parts of the project like reference
collection, review of journals, etc. are done by both. We split the coding work into two parts. The
functionalities of the lab 7 were done by myself. And my friend concentrated on lab 8
functionalities. The unit test process was conducted jointly.
8
The picture shows the sequence diagram for item management. There are seven
sequences are involved in this diagram. There are 5 locations and two shops are described. The
player walks each and every shop and locations (Morelli, 2003). Then if the player wants the
item they can purchase the item. Otherwise, ignore the item.
Contribution
This is a group activity. Our team has two members including me. In the project, major
tasks are done individually by me and my friend. Initial parts of the project like reference
collection, review of journals, etc. are done by both. We split the coding work into two parts. The
functionalities of the lab 7 were done by myself. And my friend concentrated on lab 8
functionalities. The unit test process was conducted jointly.
8
⊘ This is a preview!⊘
Do you want full access?
Subscribe today to unlock all pages.

Trusted by 1+ million students worldwide

References
Buzdin, D., & Nikiforova, O. (2012). Transformation of UML class diagram to internal java
domain-specific language. Applied Computer Systems, 13(1), 61-67. doi: 10.2478/v10312-
012-0008-0
Cardoso, T., Sousa, J., & Barata, J. (2017). Digital Games’ Development Model. EAI Endorsed
Transactions On Game-Based Learning, 4(12), 153399. doi: 10.4108/eai.8-12-2017.153399
Clingman, D., Kendall, S., & Mesdaghi, S. (2004). Practical Java game programming.
Hingham, Mass.: Charles River Media.
Foster, J., & Price, M. (2005). Sockets, shellcode, porting & coding. Rockland, Mass.: Syngress
Pub.
Handy Permana, S., Yogha Bintoro, K., Arifitama, B., & Syahputra, A. (2018). Comparative
Analysis of Pathfinding Algorithms A *, Dijkstra, and BFS on Maze Runner
Game. IJISTECH (International Journal Of Information System & Technology), 1(2), 1. doi:
10.30645/ijistech.v1i2.7
Horstmann, C. (2010). Java concepts. Hoboken, NJ: John Wiley & Sons.
Jackson, W. (2017). Pro Java 9 Games Development. New York: Apress L.P.
Kambow, L. (2012). Transformation of UML Class Diagram to UML Sequence
Diagram. International Journal Of Applied Information Systems, 2(9), 19-22. doi:
10.5120/ijais12-450413
Malik. (2014). Lennert’s Maze Game: A Diagnostic Hematological Challenge. Journal Of
Hematology. doi: 10.14740/jh165w
Malik. (2014). Lennert’s Maze Game: A Diagnostic Hematological Challenge. Journal Of
Hematology. doi: 10.14740/jh165w
Markham, N. (2014). Java programming interviews exposed. Hoboken: Wiley.
9
Buzdin, D., & Nikiforova, O. (2012). Transformation of UML class diagram to internal java
domain-specific language. Applied Computer Systems, 13(1), 61-67. doi: 10.2478/v10312-
012-0008-0
Cardoso, T., Sousa, J., & Barata, J. (2017). Digital Games’ Development Model. EAI Endorsed
Transactions On Game-Based Learning, 4(12), 153399. doi: 10.4108/eai.8-12-2017.153399
Clingman, D., Kendall, S., & Mesdaghi, S. (2004). Practical Java game programming.
Hingham, Mass.: Charles River Media.
Foster, J., & Price, M. (2005). Sockets, shellcode, porting & coding. Rockland, Mass.: Syngress
Pub.
Handy Permana, S., Yogha Bintoro, K., Arifitama, B., & Syahputra, A. (2018). Comparative
Analysis of Pathfinding Algorithms A *, Dijkstra, and BFS on Maze Runner
Game. IJISTECH (International Journal Of Information System & Technology), 1(2), 1. doi:
10.30645/ijistech.v1i2.7
Horstmann, C. (2010). Java concepts. Hoboken, NJ: John Wiley & Sons.
Jackson, W. (2017). Pro Java 9 Games Development. New York: Apress L.P.
Kambow, L. (2012). Transformation of UML Class Diagram to UML Sequence
Diagram. International Journal Of Applied Information Systems, 2(9), 19-22. doi:
10.5120/ijais12-450413
Malik. (2014). Lennert’s Maze Game: A Diagnostic Hematological Challenge. Journal Of
Hematology. doi: 10.14740/jh165w
Malik. (2014). Lennert’s Maze Game: A Diagnostic Hematological Challenge. Journal Of
Hematology. doi: 10.14740/jh165w
Markham, N. (2014). Java programming interviews exposed. Hoboken: Wiley.
9
Paraphrase This Document
Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser

McAffer, J., Lemieux, J., & Aniszczyk, C. (2010). Eclipse Rich Client Platform. [Upper Saddle
River, N.J.]: Addison-Wesley.
10
River, N.J.]: Addison-Wesley.
10
1 out of 11

Your All-in-One AI-Powered Toolkit for Academic Success.
+13062052269
info@desklib.com
Available 24*7 on WhatsApp / Email
Unlock your academic potential
© 2024 | Zucol Services PVT LTD | All rights reserved.