ITECH7201 Software Engineering: Analysis and Design of Maze Game

Verified

Added on  2022/11/15

|12
|2323
|246
Project
AI Summary
Document Page
SOFTWARE ENGINERING:
ANALYSIS AND DESIGN
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
1
Contents
1. Introduction..............................................................................................................................2
2. Maze game development Algorithm........................................................................................3
3. Lab 7 functionalities.................................................................................................................4
4. Game Environment...................................................................................................................6
5. User Stories..............................................................................................................................7
6. Class Diagram for Lab 7..........................................................................................................8
7. Sequence diagrams for Item Management...............................................................................8
8. Contribution............................................................................................................................10
9. References..............................................................................................................................11
Document Page
2
1. Introduction
Problems associated with the maze has deep roots that trace back to the myth in Greece
that Theseus had to carry out a task to destroy a Minotaur. He utilized a thread ball to know
which path he has to follow out of the maze after he had killed the animal. In this case, we will
imagine we have a turtle that is kept within the center of the maze that will have to leave the
maze.
If the Northern path taken during the first step is wrong, then a southward step will be
taken and our procedure repeated.
If there was a problem with the Southern path, then the Western path will be tried and
continuously used on the procedure.
If the West, South and North were not successful, then the Eastern path will be repeatedly
carried out.
In the event that all of the paths did not work, then the implication is that we have failed
as there is no way to leave the maze.
Even though this is looking very easy, there are many details that have to be considered.
Imagine we go north while taking our first recurrent step. When we follow the procedure, our
subsequent step would be northwards as well. But should a wall be blocking the north, we have
to check for the subsequent procedure step and attempt going southwards. By the time we are
going to the South, we would have unfortunately gotten to where we started. Should we
implement the repetitive procedure from here, a step back northwards will result in a loop that
will never end. Thus, we should be able to mark where we were. For this scenario, we will take it
that there is a bread crumbs bag that can be kept on the way. When we move to a particular
direction and discover bread crumbs bag is already there, it would be an indication that we have
been there before and that we must immediately retreat and attempt to take a different direction.
We will find out when we take a look at the algorithm code that retreating is equivalent to a
repetitive function call return.
Document Page
3
2. Maze game development Algorithm
An algorithm, which could be used for maze generation is the Depth-first search. It is a
really easy and simple idea to execute for implementing using stack or recursive method. Depth
First Search (or Traversal) for graphs is related to the Depth First Search for a tree. However, as
opposed to trees, cycles could be contained in graphs, this might lead us to a particular node
again. So that we do not process a particular node a second time, the array known as Boolean
visited is used. The DFS space and time analysis is different based on the application area.
Theoretically, DFS is basically utilized for traversing the whole graph and consumes time
linearly in the graph’s size. For these applications, space is also used in the most difficult case
for vertices stack storage on the present search path and the already-visited vertices set.
Therefore, for this setting, bounds for space and time are similar to the breadth-first traversal
(Andrews, Menzies & Li, 2011). Selecting if the first or second algorithm will be used has less
dependence on how complex they are and more dependence on the different vertex orderings
properties that is produced by the two algorithms.
Typically, you begin from any point randomly and continue to dig paths among the 4
directions (north, east, west and south) till there is no way. When you get stuck, you go
backwards till you get an open space (Hendrawan, 2018). You can continue to dig from there. It
simply implies repeating these.
Steps
1. Develop an array of 2 dimensions with odd column and row size. Paths (orange cell) are
represented by 0 and walls (black cells) are represented by 1.
2. Produce odd numbers for col and row. Change the cell to 0. Use the variables for col and
row to monitor the present location.
3. Select a direction randomly you intend to move to. Movement will always be based on 2
cells. It is illustrated in the picture above the movement of the current cell downwards.
There are a number of things that you should check during a movement. Initially, you
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
4
should check if 2 cells forward from where you are is not within the maze (Hojjat,
Ikemoto & Sowa, 2017).
3. Lab 7 functionalities
Interpretative Factory
Create a GUI widgets’ interpretative factory. The factory utilizes 2 string parameters for
determining the instantiate class: A parameter is regarded as a variable for instance and shows
the GUI theme, the second parameter shows the widget that should be created.
The resulting functionalities will happen in laboratory 7
Command parser creation
It is important to find a way of stopping input from user before we start command
implementation and add more functionality to the game. The format for command
<argument(s)> that is move west. Thus, what is needed is the breaking up of input from the user
from a singular words number string as well as identify the arguments and the commands. We
can imagine that the initial encountered word in input from user is a command, while the others
are argument(s). It is possible to make the parser for command a bit friendlier to the user by
removing words that are commonly used that are not commands or useful arguments. That is, if
“go to the north” is typed by the user, it is possible to drop and to. (Kim, Kim & Kim, 2011)
Let’s start by the creation of a class to represent input analyzed into arguments and command. A
new class will be created in Control package known as Parsed Input.
A new class should be created and named Parser in the package.
Now we have a class for analyzing the input of the user, based on the commands list it
was provided during its construction.
Document Page
5
Adding handling of Command to DungeonMaster class
A command has been passed and we intend to utilize it. Prior to that, we have to create a
little adjustment to the interface of the user to accommodate command retrieval from the user.
We might utilize Get Reply for commands retrieval purpose. However, the actual design of the
method is to question the player . We can introduce another method specially to get commands
from the player. Now that we have setup our client to get user commands, DungeonMaster can
be modified. Currently, our game has the ability to interpret commands, as opposed to quitting, it
actually does nothing. Also, our class, Dungeonmaster, is now becoming messy and will need
reconstruction. Next week, we will deal with this when we will talk about the pattern for
Command design.
Move Player command implementation
The RAD explains the User Story for Move Party
Move Party – the players indicate the way they desire the party to travel. If there is an
exit in the specified way, the location of the player’s party is updated with the new
location’s description.
During this phase, we are determined to leave out the parties so that user story can be rewritten
as:
Move Player – the players indicate the way in wish they desire to travel. If there is an exit
in the specified way, the location of the player is updated in the system and the new
location’s description is updated by the system. (Mohammad Shahabuddin & Prasanth,
2016)
The Setup Player technique is adjusted in DungeonMaster. We then adjust the class of the
location so that we can get an Exit. Since we now have the class setup for location for the
retrieval of Exit, DungeonMaster class can be adjusted to accommodate movement of the player.
Document Page
6
Adjust the ProcessPlayerTurn and a new technique implementation known as processMove in
the DungeonMaster. (Qiang, Xiaofeng, Likai, Sheng & Han, 2018)
When you execute the game, type “move west” to check what happens. During this,
player movement have been implemented in a very crude way. You may want to consider what
you can do to improve it so that it is more usable with testing some play (for instance,
developing a ToString technique where you are such as the Location name and Description and
updating with both might be better than just updating the description only). We will leave this as
a further exercise that is optional. (Runeson, 2006)
4. Game Environment
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
7
Here the created map for the maze game is shown. Here the map developed based on the
given condition. The first condition is M (locations) must be greater than the N (shops). And the
second condition is must be greater than or equal to 5 and the N must be greater than or equal to
2. During the map creation, we considered both conditions. Here the developed map satisfies
both conditions. In the created map totally there are 2 shops (jewelry shop, coffee shop) and 5
locations (office, parks, and bank, etc.). In the developed map paths are given by double-dotted
lines.
5. User Stories
In the game, development process user stories are the specifications and features
preferred by the users. In other words, it is called users requirements. These requirements are
collected from different methods like survey, interview, etc. Generally, these requirements are
there in natural language. The developer must convert the user requirements into the technical
requirements.
As a maze game player, I need the following features,
Move on different directions,
Go in and come out from various locations
Collect the different coins and other collectibles,
Buy different weapons and boosters,
Sell the collected things,
Use different weapons, etc.
So that I can enjoy the game.
Document Page
8
6. Class Diagram for Lab 7
The class diagram in UML is one of the best methods to describe the static structure of
the game or application. In class diagram system classes, its attributes, methods and internal
relationship among the different objects are shown. Here we have drawn the class diagram with
the intention of describing the static structure of the classifiers and code development process
etc.
Document Page
9
7. Sequence diagrams for Item Management
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
10
8. Contribution
The attached table clearly describes the work done by me and my teammate.
Work done by me Work done by my friend
Initial Analysis
Developed coding for
o Motion
o Starting and ending the game
o Lock and unlock the
characteristics.
o Weapon changing etc.
Map creation
Developed coding for
o Help
o Get item and drop item
o Buy item and sell item
Document Page
11
9. References
Andrews, J., Menzies, T., & Li, F. (2011). Genetic Algorithms for Randomized Unit
Testing. IEEE Transactions On Software Engineering, 37(1), 80-94. doi:
10.1109/tse.2010.46
Hendrawan, Y. (2018). A Maze Game on Android Using Growing Tree Method. Journal Of
Physics: Conference Series, 953, 012148. doi: 10.1088/1742-6596/953/1/012148
Hojjat, S., Ikemoto, C., & Sowa, T. (2017). Maze and Mirror Game Design for Increasing
Motivation in Studying Science in Elementary School Students. EAI Endorsed Transactions
On Creative Technologies, 4(12), 153155. doi: 10.4108/eai.3-10-2017.153155
Kim, M., Kim, Y., & Kim, H. (2011). A Comparative Study of Software Model Checkers as Unit
Testing Tools: An Industrial Case Study. IEEE Transactions On Software
Engineering, 37(2), 146-160. doi: 10.1109/tse.2010.68
Mohammad Shahabuddin, S., & Prasanth, Y. (2016). Integration Testing Prior to Unit Testing: A
Paradigm Shift in Object Oriented Software Testing of Agile Software Engineering. Indian
Journal Of Science And Technology, 9(20). doi: 10.17485/ijst/2016/v9i20/91223
Qiang, T., Xiaofeng, Z., Likai, L., Sheng, Y., & Han, W. (2018). The Design of Game Platform
Based on Java. IOP Conference Series: Materials Science And Engineering, 435, 012014.
doi: 10.1088/1757-899x/435/1/012014
Runeson, P. (2006). A survey of unit testing practices. IEEE Software, 23(4), 22-29. doi:
10.1109/ms.2006.91
chevron_up_icon
1 out of 12
circle_padding
hide_on_mobile
zoom_out_icon
[object Object]