Addis Ababa Institute of Technology Center of Information Technology and Scientific Computing Department of SW Eng
Addis Ababa Institute of Technology Center of Information Technology and Scientific Computing Department of SW Eng
Addis Ababa Institute of Technology Center of Information Technology and Scientific Computing Department of SW Eng
May 2018
Table of Contents
List of Tables................................................................................................................................................ii
List of figures..............................................................................................................................................iii
Definitions, Acronyms, Abbreviations.........................................................................................................iv
1. Introduction.........................................................................................................................................1
1.1 Purpose..............................................................................................................................................1
1.2 General Overview........................................................................................................................1
1.3 Development Methods & Contingencies...........................................................................................1
2. System Architecture............................................................................................................................2
2.1 Subsystem decomposition..................................................................................................................2
2.2 Hardware/software mapping..............................................................................................................4
3. Object Model..........................................................................................................................................5
3.1 Class Diagram....................................................................................................................................5
3.2 Sequence Diagram.............................................................................................................................6
3.2 State chart Diagram.........................................................................................................................12
4. Detailed Design......................................................................................................................................12
References.................................................................................................................................................20
i|Page
List of Tables
Table 1: General description of Game class...............................................................................................13
Table 2: Attribute description of Game class.............................................................................................13
Table 3: Operation description of Game class...........................................................................................14
Table 4: General description of Player class..............................................................................................14
Table 5: Attribute description of Player class............................................................................................15
Table 6: Operational description of Player class........................................................................................15
Table 7: General description of Settings class............................................................................................16
Table 8: Attribute description of Settings class..........................................................................................16
Table 9: Operational description of Settings class.....................................................................................16
Table 10: General description of Mob class...............................................................................................17
Table 11: Attribute description of Mob class.............................................................................................17
Table 12: Operational description of Mob class........................................................................................17
Table 13: General description of SpriteSheet class....................................................................................18
Table 14: Attribute description of SpriteSheet class..................................................................................18
Table 15: Operational description of SpriteSheet class.............................................................................18
Table 16: General description of Platform class........................................................................................18
Table 17: Attribute description of Platform class.......................................................................................18
Table 18: General description of AI class...................................................................................................19
Table 19: Operational description of AI class.............................................................................................19
ii | P a g e
List of figures
Figure 1: layer 1 component diagram..........................................................................................................2
Figure 2: layer 2 component diagram..........................................................................................................2
Figure 3: layer 3 component diagram..........................................................................................................3
Figure 4: deployment diagram....................................................................................................................4
Figure 5: class diagram................................................................................................................................5
Figure 6: play game sequence diagram.......................................................................................................6
Figure 7: settings sequence diagram...........................................................................................................6
Figure 8: pause game sequence diagram....................................................................................................7
Figure 9: change audio sequence diagram..................................................................................................8
Figure 10: change difficulty sequence diagram...........................................................................................9
Figure 11: change keybindings sequence diagram....................................................................................10
Figure 12: exit game sequence diagram....................................................................................................11
Figure 13: state diagram............................................................................................................................12
iii | P a g e
Definitions, Acronyms, Abbreviations
Layered Pattern: a pattern that can be used to structure programs that can be decomposed into
groups of subtasks, each of which is at a particular level of abstraction. Each layer provides
services to the next higher layer.
GUI: graphical user interface
iv | P a g e
1. Introduction
1.1 Purpose
The purpose of System Design document is to translate the business requirements and business
processes into a technical design that will be used to develop the application.
The three-tier architecture style shall be used because it not only separates the user interface
and the metadata, but also provides an application logic layer. The application layer provides a
middle layer that allows the data files and the GUI components to be loosely coupled. The
application layer has to be modified if there are any changes to the format of the data files and
the interface layer will need little or no modification. This will make it easy for clients of this
software to modify the data file format and attributes for further research purposes if they wish to
do so. This layer makes the system more maintainable and reusable and also hides the
complexity of processing data from the users.
1|Page
2. System Architecture
2.1 Subsystem decomposition
2|Page
Figure 3: layer 3 component diagram
3|Page
2.2 Hardware/software mapping
4|Page
3. Object Model
3.1 Class Diagram
5|Page
3.2 Sequence Diagram
6|Page
Figure 8: pause game sequence diagram
7|Page
Figure 9: change audio sequence diagram
8|Page
Figure 10: change difficulty sequence diagram
9|Page
Figure 11: change keybindings sequence diagram
10 | P a g e
Figure 12: exit game sequence diagram
11 | P a g e
3.2 State chart Diagram
4. Detailed Design
Game
- clock:pygame.time.Clock
- running:boolean
- loadData()
- new()
- run()
- update()
+ events()
+ draw()
+ showStartScreen()
+ showPauseScreen()
12 | P a g e
+ showSettingsScreen()
+ showAudioScreen()
+ showDifficultyScreen()
+ showKeybindingsScreen()
+ showGoSCreen()
+ drawText(text, size, color, x, y)
+ button(text,x,y,width,height,color)
Table 1: General description of Game class
Player
+ vx:int
+ vy:int
- img:image
- walking:boolean
- jumping:boolean
- current_frame:int
- last_frame:int
+ update()
+ jump()
+ animate()
14 | P a g e
Attribute Type Visibility Invariant
vx Integer Public vx <> NULL
img Image Private Img should have an some image for initial value
walking Boolean Private walking should be a Boolean with the initial value of False.
jumping Boolean Private jumping should be a Boolean with the initial value of False.
current_frame Integer Private current_frame should be integer with the initial value of 0
last_frame Integer Private last_frame should be integer with the initial value of 0
Settings
+ width:int
+ height:int
+ fps:int
+ title:String
+ highscore_file:String
+ settings_file: String
+ SPRITESHEET:String
+ difficulty_file:String
15 | P a g e
+ AI_data:String
+ changeSettings()
Mob
- img:image
- game:Game
- vy:Double
- dy:Double
- walking:boolean
- jumping:boolean
16 | P a g e
- current_frame:int
- last_frame:int
+ update()
+ read()
walking Boolean Private walking should be a Boolean with the initial value of False.
jumping Boolean Private jumping should be a Boolean with the initial value of False.
current_frame Integer Private current_frame should be integer with the initial value of 0
last_frame Integer Private last_frame should be integer with the initial value of 0
SpriteSheet
+ spritesheet:image
17 | P a g e
+ getImage(x, y, width, height):image
Platform
- img:image
- rect:image.get_rect
- game:Game
18 | P a g e
AI
+ learn()
- write()
- update()
Table 18: General description of AI class
19 | P a g e
References
Smartdraw; https://www.smartdraw.com/component-diagram/#whatisComponentDiagram, On
May 17 2018
20 | P a g e