Sunteți pe pagina 1din 27

Ball Game project

Documentation Report

Filename:
Status:
Date:
Author:

256201502.doc
draft
David Hill

256201502.doc
David Hill

3.1.2015
2 (27)

Table of contents
Ball Game project: Project Model.............................................................................................................3
Ball Game structure - analysis: Class Diagram [UML].........................................................................4
Ball Game structure - design: Class Diagram [UML]...........................................................................9
Ball Game behaviour - Design: Sequence Diagram............................................................................17
States of the Ball: State Machine Diagram..........................................................................................21
Ball Game requirements: Use Case Diagram......................................................................................27

256201502.doc
David Hill

3.1.2015
3 (27)

Ball Game project: Project Model


The Ball Game project is concerned with developing a video game, where the player attempts to break
through a wall by knocking out bricks with a ball, which he or she bounces on his paddle.
Status of project model: draft
Project manager: David Hill
Personnel:
Person name Email address
Contact information
David Hill
mailto:info@metacase.com Park Court
Upper Essex Street
City 5
B8 6QB
Joe Smith
mailto:info@metacase.com www.metacase.com
Project model picture: Ball Game project

Documentation includes following graphs and subprojects:


Graph name
Documentation
Ball Game structure Preliminary classes of the game are identified.
analysis
Ball Game structure - design
Ball game structure class diagram displays basic structure of the ball
game. Game's idea is to remove all the bricks from the wall by
striking them with the ball.
Ball Game behaviour This model describes interactions among the Ball game objects during
Design
the game.
States of the Ball
This diagram describes the states of the ball and possible transitions
between the states. It reuses events and operations from the class
diagram (e.g. Start game, move, calculateNewDirection).
Ball Game requirements
This model describes the use cases for the ball game application.
Generated from MetaEdit+ project documentation report

256201502.doc
David Hill

3.1.2015
4 (27)

Ball Game structure - analysis: Class Diagram [UML]


Status: draft
Personnel: Joe Smith
Documentation: Preliminary classes of the game are identified.
Diagram picture: Ball Game structure - analysis

Graph dictionary
Object
Ball
BallGame
Brick
Paddle
Wall
This model describes the class structure of the game identified in
the analysis phase.

Type of Object
Class [UML]
Class [UML]
Class [UML]
Class [UML]
Class [UML]
Note text

Documentation

256201502.doc
David Hill

Ball: Class [UML]


Properties:
Class name
Attributes [UML]
Operations [UML]
Package
Abstract?
Persistent?
Stereotype for class
Overridability
Role
Parameters
Constraints
Invariant
Derivation rules
Responsibility
Documentation
Simple symbol?

Ball
+position
F
F

Ball relationships:
In role In relationship
: Part
: Aggregation
Ball links:
Link type
Decomposition
Explosions

With objects(s)
BallGame

In role
: Whole

Graph's name
none
none

BallGame: Class [UML]


Properties:
Class name
Attributes [UML]
Operations [UML]
Package
Abstract?
Persistent?
Stereotype for class
Overridability
Role
Parameters
Constraints
Invariant
Derivation rules
Responsibility
Documentation
Simple symbol?

BallGame

T
F

BallGame relationships:
In role
In relationship
: Whole : Aggregation
: Whole : Aggregation

With objects(s)
Paddle
Ball

In role
: Part
: Part

3.1.2015
5 (27)

256201502.doc
David Hill

: Whole

: Aggregation

BallGame links:
Link type
Decomposition
Explosions

Wall

: Part

Graph's name
none
none

Brick: Class [UML]


Properties:
Class name
Attributes [UML]
Operations [UML]
Package
Abstract?
Persistent?
Stereotype for class
Overridability
Role
Parameters
Constraints
Invariant
Derivation rules
Responsibility
Documentation
Simple symbol?

Brick

F
F

Brick relationships:
In role In relationship
: Part
: Aggregation
Brick links:
Link type
Decomposition
Explosions

With objects(s)
Wall

Graph's name
none
none

In role
: Whole

3.1.2015
6 (27)

256201502.doc
David Hill

Paddle: Class [UML]


Properties:
Class name
Attributes [UML]
Operations [UML]
Package
Abstract?
Persistent?
Stereotype for class
Overridability
Role
Parameters
Constraints
Invariant
Derivation rules
Responsibility
Documentation
Simple symbol?

Paddle

F
F

Paddle relationships:
In role In relationship
: Part
: Aggregation
Paddle links:
Link type
Decomposition
Explosions

With objects(s)
BallGame

In role
: Whole

Graph's name
none
none

Wall: Class [UML]


Properties:
Class name
Attributes [UML]
Operations [UML]
Package
Abstract?
Persistent?
Stereotype for class
Overridability
Role
Parameters
Constraints
Invariant
Derivation rules
Responsibility
Documentation
Simple symbol?

Wall

F
F

Wall relationships:
In role
In relationship
: Part
: Aggregation

With objects(s)
BallGame

In role
: Whole

3.1.2015
7 (27)

256201502.doc
David Hill

: Whole

: Aggregation

Wall links:
Link type
Decomposition
Explosions

Brick

3.1.2015
8 (27)

: Part

Graph's name
none
none

This model describes the class structure of the game identified in the analysis phase.:
Note text
Properties:
Documentation

This model describes the class structure of the game identified in the analysis
phase.

Stereotype for note


This model describes the class structure of the game identified in the analysis phase. relationships:
none
This model describes the class structure of the game identified in the analysis phase. links:
Link type
Graph's name
Decomposition none
Explosions
none

256201502.doc
David Hill

3.1.2015
9 (27)

Ball Game structure - design: Class Diagram [UML]


Status: draft
Personnel: David Hill
Documentation: Ball game structure class diagram displays basic structure of the ball game. Game's
idea is to remove all the bricks from the wall by striking them with the ball.
Diagram picture: Ball Game structure - design

Graph dictionary
Object
Type of Object
Ball
Class [UML]
BallGame
Brick

Class [UML]
Class [UML]

MovingObject

Class [UML]

Documentation
Ball is the basic element of the game. Player tries to remove
bricks by hitting them with the ball.
This is the main application class.
Single element of the wall. These will disappear, when the ball
hits them.
MovingObject is an abstract class for all moving components of
the ball game.

256201502.doc
David Hill

Paddle
TopScore
Wall

Class [UML]
Class [UML]
Class [UML]

3.1.2015
10 (27)

Player tries to keep the ball in play by hitting it with the paddle.
Stores one of the top scores and the player who achieved it.
Walls are generally immobile; the ball bounces back off them
giving no points.

Ball: Class [UML]


Properties:
Class name
Attributes [UML]
Operations [UML]
Package
Abstract?
Persistent?
Stereotype for class
Overridability
Role
Parameters
Constraints
Invariant
Derivation rules
Responsibility
Documentation
Simple symbol?
Ball relationships:
In role
: Part

: Specialization

Ball links:
Link type
Decomposition
Explosions

Ball
+void display() +void calculateNewDirection(MovingObject hitObject) +void
check position()
Game
F
F

Ball is the basic element of the game. Player tries to remove bricks by hitting
them with the ball.
F

In relationship
: Aggregation

: Generalization
[UML]

Graph's name
none
States of the Ball

With objects(s)
Paddle
Wall
Brick
BallGame
Paddle

In role
: Part
: Part
: Part
: Whole
: Specialization

Brick
Wall
MovingObject

: Specialization
: Specialization
: Superclass

256201502.doc
David Hill

3.1.2015
11 (27)

BallGame: Class [UML]


Properties:
Class name
Attributes [UML]
Operations [UML]
Package
Abstract?
Persistent?
Stereotype for class
Overridability
Role
Parameters
Constraints
Invariant
Derivation rules
Responsibility
Documentation
Simple symbol?

BallGame
#currentScore:int = 0 -ballsLeft:integer = 3 +playerName:String
+void displayGameOverText() +void displayPlayersScore() +void playTune()
+void decrementBalls() +void initialize()
Game
F
F

This is the main application class.


F

BallGame relationships:
In role
In relationship
: Whole
: Aggregation
: Whole
: Aggregation

BallGame links:
Link type
Decomposition
Explosions

With objects(s)
TopScore
Paddle
Ball
Wall
Brick

In role
: Part
: Part
: Part
: Part
: Part

Graph's name
none
none

Brick: Class [UML]


Properties:
Class name
Attributes [UML]
Operations [UML]
Package
Abstract?
Persistent?
Stereotype for class
Overridability
Role
Parameters
Constraints
Invariant
Derivation rules
Responsibility
Documentation
Simple symbol?

Brick
+value:int = 1
+void playHitSound() +void increaseScore()
Game
F
F

Single element of the wall. These will disappear, when the ball hits them.
F

256201502.doc
David Hill

Brick relationships:
In role
: Part

In relationship
: Aggregation

: Specialization

Brick links:
Link type
Decomposition
Explosions

: Generalization
[UML]

3.1.2015
12 (27)

With objects(s)
Paddle
Ball
Wall
BallGame
Paddle

In role
: Part
: Part
: Part
: Whole
: Specialization

Ball
Wall
MovingObject

: Specialization
: Specialization
: Superclass

Graph's name
none
none

MovingObject: Class [UML]


Properties:
Class name
Attributes [UML]
Operations [UML]
Package
Abstract?
Persistent?
Stereotype for class
Overridability
Role
Parameters
Constraints
Invariant
Derivation rules
Responsibility
Documentation
Simple symbol?

MovingObject
+position:Point = 100.0@100.0 -velocity:Point = 0.0@2.0 +extent:Point
-colour:ColorValue
+void display() +void move(Point position, int direction) +void checkHits()
Game
T
F
model

MovingObject is an abstract class for all moving components of the ball


game.
F

MovingObject relationships:
In role
In relationship
: Superclass
: Generalization
[UML]

MovingObject links:
Link type
Graph's name
Decomposition none
Explosions
none

With objects(s)
Paddle

In role
: Specialization

Ball
Brick
Wall

: Specialization
: Specialization
: Specialization

256201502.doc
David Hill

3.1.2015
13 (27)

Paddle: Class [UML]


Properties:
Class name
Attributes [UML]
Operations [UML]
Package
Abstract?
Persistent?
Stereotype for class
Overridability
Role
Parameters
Constraints
Invariant
Derivation rules
Responsibility
Documentation
Simple symbol?
Paddle relationships:
In role
: Part

: Specialization

Paddle links:
Link type
Decomposition
Explosions

Paddle
+maxSpeed
+void playHitSound()
Game
F
F

Player tries to keep the ball in play by hitting it with the paddle.
F

In relationship
: Aggregation

: Generalization
[UML]

Graph's name
none
none

With objects(s)
Ball
Wall
Brick
BallGame
Ball

In role
: Part
: Part
: Part
: Whole
: Specialization

Brick
Wall
MovingObject

: Specialization
: Specialization
: Superclass

256201502.doc
David Hill

3.1.2015
14 (27)

TopScore: Class [UML]


Properties:
Class name
Attributes [UML]
Operations [UML]
Package
Abstract?
Persistent?
Stereotype for class
Overridability
Role
Parameters
Constraints
Invariant
Derivation rules
Responsibility
Documentation
Simple symbol?

TopScore
+playerName:String +score:int = 0
Game
F
T

Stores one of the top scores and the player who achieved it.
F

TopScore relationships:
In role In relationship
: Part
: Aggregation
TopScore links:
Link type
Decomposition
Explosions

With objects(s)
BallGame

In role
: Whole

Graph's name
none
none

Wall: Class [UML]


Properties:
Class name
Attributes [UML]
Operations [UML]
Package
Abstract?
Persistent?
Stereotype for class
Overridability
Role
Parameters
Constraints
Invariant
Derivation rules
Responsibility
Documentation
Simple symbol?
Wall relationships:
In role
: Part

Wall

F
F

Walls are generally immobile; the ball bounces back off them giving no
points.
T

In relationship
: Aggregation

With objects(s)
Paddle

In role
: Part

256201502.doc
David Hill

: Specialization

Wall links:
Link type
Decomposition
Explosions

: Generalization
[UML]

Graph's name
none
none

3.1.2015
15 (27)

Ball
Brick
BallGame
Paddle

: Part
: Part
: Whole
: Specialization

Ball
Brick
MovingObject

: Specialization
: Specialization
: Superclass

256201502.doc
David Hill

3.1.2015
16 (27)

Ball Game behaviour - Design: Sequence Diagram


Status: draft
Personnel: David Hill
Documentation: This model describes interactions among the Ball game objects during the game.
Diagram picture: Ball Game behaviour - Design

Graph dictionary
Object
:Ball
:BallGame
:Brick
:MovingObject
:Paddle
Outside actor

Type of Object
Lifeline object
Lifeline object
Lifeline object
Lifeline object
Lifeline object
Outside actor

Documentation

256201502.doc
David Hill

3.1.2015
17 (27)

:Ball: Lifeline object


Properties:
Object name
Class
Stop?
Documentation

Ball
F

:Ball relationships:
In role
In relationship
: Message to
check position: Call
: Message to
calculateNewDirection: Call
: Message to
calculateNewDirection: Call
: Return from : Return
: Return from position: Return
: Return from : Return
:Ball links:
Link type
Decomposition
Explosions

With objects(s)
:MovingObject
:MovingObject
:Paddle
:MovingObject
:MovingObject
:MovingObject

In role
: Message from
: Message from
: Message from
: Return to
: Return to
: Return to

Graph's name
none
none

:BallGame: Lifeline object


Properties:
Object name
Class
Stop?
Documentation

BallGame
T

:BallGame relationships:
In role
In relationship
: Message from checkHits: Call
: Message from move: Call
: Message from displayGameOverText: Call
: Message from displayPlayersScore: Call
: Message to
decrementBalls: Call
: Message to
: Call
: Message to
displayGameOverText: Call
: Message to
displayPlayersScore: Call
: Return from
: Return
: Return to
: Return
:BallGame links:
Link type
Decomposition
Explosions

Graph's name
none
none

With objects(s)
:MovingObject
:MovingObject
:BallGame
:BallGame
:MovingObject
Outside actor
:BallGame
:BallGame
Outside actor
:MovingObject

In role
: Message to
: Message to
: Message to
: Message to
: Message from
: Message from
: Message from
: Message from
: Return to
: Return from

256201502.doc
David Hill

3.1.2015
18 (27)

:Brick: Lifeline object


Properties:
Object name
Class
Stop?
Documentation

Brick
F

:Brick relationships:
In role
In relationship
: Message to
increaseScore: Call
: Message to
playHitSound: Call
: Return from : Return
: Return from : Return
:Brick links:
Link type
Decomposition
Explosions

With objects(s)
:MovingObject
:MovingObject
:MovingObject
:MovingObject

In role
: Message from
: Message from
: Return to
: Return to

Graph's name
none
none

:MovingObject: Lifeline object


Properties:
Object name
Class
Stop?
Documentation

MovingObject
F

:MovingObject relationships:
In role
In relationship
: Message from increaseScore: Call
: Message from decrementBalls: Call
: Message from check position: Call
: Message from playHitSound: Call
: Message from calculateNewDirection: Call
: Message from playHitSound: Call
: Message to
checkHits: Call
: Message to
move: Call
: Return from
: Return
: Return to
: Return
: Return to
: Return
: Return to
position: Return
: Return to
: Return
: Return to
: Return
:MovingObject links:
Link type
Graph's name
Decomposition none
Explosions
none

With objects(s)
:Brick
:BallGame
:Ball
:Brick
:Ball
:Paddle
:BallGame
:BallGame
:BallGame
:Ball
:Brick
:Ball
:Ball
:Brick

In role
: Message to
: Message to
: Message to
: Message to
: Message to
: Message to
: Message from
: Message from
: Return to
: Return from
: Return from
: Return from
: Return from
: Return from

256201502.doc
David Hill

3.1.2015
19 (27)

:Paddle: Lifeline object


Properties:
Object name
Class
Stop?
Documentation

Paddle
F

:Paddle relationships:
In role
In relationship
: Message from calculateNewDirection: Call
: Message to
playHitSound: Call
:Paddle links:
Link type
Decomposition
Explosions

With objects(s)
:Ball
:MovingObject

Graph's name
none
none

Outside actor: Outside actor


Properties:
Outside actor relationships:
In role
In relationship
: Message from : Call
: Return to
: Return
Outside actor links:
Link type
Graph's name
Decomposition none
Explosions
none

With objects(s)
:BallGame
:BallGame

In role
: Message to
: Return from

In role
: Message to
: Message from

256201502.doc
David Hill

3.1.2015
20 (27)

States of the Ball: State Machine Diagram


Status: frozen
Personnel: Joe Smith
Documentation: This diagram describes the states of the ball and possible transitions between the
states. It reuses events and operations from the class diagram (e.g. Start game, move,
calculateNewDirection).
Diagram picture: States of the Ball

Graph dictionary
Object
This diagram describes the
states of the ball and possible
transitions between the states.
It reuses events and
operations from the class
diagram (e.g. initialize,
move,
calculateNewDirection).
Start
Behind the paddle

Type of Object
Note text

Start
State [UML]

Hits a brick

State [UML]

Hits a wall

State [UML]

Documentation

When player misses the ball, the number of balls


left decreases by one and a tune is played.
When the ball hits a brick the Hit sound is played,
the brick's value is added to the player's scores and
new direction for the ball is calculated.
When the ball hits the wall, a new direction for the
ball is calculated.

256201502.doc
David Hill

Hits the paddle

State [UML]

Initialized

State [UML]

Moving

State [UML]

Play a game
Stop

State [UML]
Stop

3.1.2015
21 (27)

When ball hits the paddle the Hit sound is played,


and new direction for the ball is calculated.
In the beginning the direction of the ball is
initialized to 0 which means movement directly up.
When the game has begun, the ball is mostly
moving with the current direction and speed.

This diagram describes the states of the ball and possible transitions between the
states. It reuses events and operations from the class diagram (e.g. initialize,
move, calculateNewDirection).: Note text
Properties:
Documentation

This diagram describes the states of the ball and possible transitions between
the states. It reuses events and operations from the class diagram (e.g.
initialize, move, calculateNewDirection).

Stereotype for note


This diagram describes the states of the ball and possible transitions between the states. It reuses
events and operations from the class diagram (e.g. initialize, move, calculateNewDirection).
relationships:
none
This diagram describes the states of the ball and possible transitions between the states. It reuses
events and operations from the class diagram (e.g. initialize, move, calculateNewDirection). links:
Link type
Graph's name
Decomposition none
Explosions
none
Start: Start
Properties:
Start relationships:
In role In relationship
: From initialize: Transition [UML]
Start links:
Link type
Decomposition
Explosions

With objects(s)
Initialized

In role
: To

Graph's name
none
none

Behind the paddle: State [UML]


Properties:
State name
Internal activities
Documentation
Symbol transparent?

Behind the paddle


entry / playTune entry / decrementBalls(1, bar)
When player misses the ball, the number of balls left decreases by one and a
tune is played.
F

256201502.doc
David Hill

Behind the paddle relationships:


In role In relationship
: From decrementBalls: Transition [UML]
: From : Transition [UML]
: To
: Transition [UML]

With objects(s)
Initialized
Stop
Moving

3.1.2015
22 (27)

In role
: To
: To
: From

Behind the paddle links:


Link type
Graph's name
Decomposition none
Explosions
none
Hits a brick: State [UML]
Properties:
State name
Internal activities
Documentation
Symbol transparent?

Hits a brick
entry / playHitSound entry / increaseScore(1) exit / calculateNewDirection
When the ball hits a brick the Hit sound is played, the brick's value is added
to the player's scores and new direction for the ball is calculated.
F

Hits a brick relationships:


In role In relationship
: From : Transition [UML]
: To
: Transition [UML]

With objects(s)
Moving
Moving

In role
: To
: From

Hits a brick links:


Link type
Graph's name
Decomposition none
Explosions
none
Hits a wall: State [UML]
Properties:
State name
Internal activities
Documentation
Symbol transparent?

Hits a wall
entry / calculateNewDirection
When the ball hits the wall, a new direction for the ball is calculated.
F

Hits a wall relationships:


In role In relationship
: From : Transition [UML]
: To
: Transition [UML]
Hits a wall links:
Link type
Decomposition
Explosions

With objects(s)
Moving
Moving

Graph's name
none
none

In role
: To
: From

256201502.doc
David Hill

3.1.2015
23 (27)

Hits the paddle: State [UML]


Properties:
State name
Internal activities
Documentation
Symbol transparent?

Hits the paddle


entry / playHitSound entry / calculateNewDirection
When ball hits the paddle the Hit sound is played, and new direction for the
ball is calculated.
F

Hits the paddle relationships:


In role In relationship
: From : Transition [UML]
: To
: Transition [UML]

With objects(s)
Moving
Moving

In role
: To
: From

Hits the paddle links:


Link type
Graph's name
Decomposition none
Explosions
none
Initialized: State [UML]
Properties:
State name
Internal activities
Documentation

Initialized

Symbol transparent?

In the beginning the direction of the ball is initialized to 0 which means


movement directly up.
F

Initialized relationships:
In role In relationship
: From : Transition [UML]
: To
initialize: Transition [UML]
: To
decrementBalls: Transition [UML]
Initialized links:
Link type
Decomposition
Explosions

With objects(s)
Moving
Start
Behind the paddle

In role
: To
: From
: From

Graph's name
none
none

Moving: State [UML]


Properties:
State name
Internal activities
Documentation
Symbol transparent?

Moving
do / move
When the game has begun, the ball is mostly moving with the current
direction and speed.
F

Moving relationships:
In role In relationship
: From : Transition [UML]
: From : Transition [UML]
: From : Transition [UML]

With objects(s)
Behind the paddle
Hits a wall
Hits a brick

In role
: To
: To
: To

256201502.doc
David Hill

: From
: To
: To
: To
: To

: Transition [UML]
: Transition [UML]
: Transition [UML]
: Transition [UML]
: Transition [UML]

Moving links:
Link type
Decomposition
Explosions

Hits the paddle


Initialized
Hits a brick
Hits the paddle
Hits a wall

: To
: From
: From
: From
: From

Graph's name
none
none

Play a game: State [UML]


Properties:
State name
Internal activities
Documentation
Symbol transparent?

Play a game
T

Play a game relationships:


none
Play a game links:
Link type
Graph's name
Decomposition none
Explosions
none
Stop: Stop
Properties:
Stop relationships:
In role In relationship
: To
: Transition [UML]
Stop links:
Link type
Decomposition
Explosions

With objects(s)
Behind the paddle

Graph's name
none
none

In role
: From

3.1.2015
24 (27)

256201502.doc
David Hill

3.1.2015
25 (27)

Ball Game requirements: Use Case Diagram


Status: draft
Personnel: Joe Smith
Documentation: This model describes the use cases for the ball game application.
Diagram picture: Ball Game requirements

Graph dictionary
Object
Player
Ball game
Play a game

Type of Object
Actor [UML]
System [UML]
Use case [UML]

View high scores

Use case [UML]

Documentation
Player who plays the ball game or views the high scores.
The user can play a game which a traditional ball game:
player moves the paddle and tries to remove the bricks from
the field by hitting them with the ball. The player has three
balls per game.
Scores of the best games and stored automatically and the
user can view top 10 list. The list includes scores and player
names.

Player: Actor [UML]


Properties:
Class name
Documentation

Player
Player who plays the ball game or views the high scores.

Player relationships:
In role
In relationship
: Association role : Association [UML]
: Association role : Association [UML]
Player links:
Link type
Decomposition
Explosions

Graph's name
none
none

With objects(s)
Play a game
View high scores

In role
: Association role
: Association role

256201502.doc
David Hill

3.1.2015
26 (27)

Ball game: System [UML]


Properties:
Class name
Documentation

Ball game

Ball game relationships:


none
Ball game links:
Link type
Decomposition
Explosions

Graph's name
none
none

Play a game: Use case [UML]


Properties:
Class name
Attributes [UML]
Operations [UML]
Documentation file
Extension points
Documentation

Play a game

The user can play a game which a traditional ball game: player moves the
paddle and tries to remove the bricks from the field by hitting them with the
ball. The player has three balls per game.

Play a game relationships:


In role
In relationship
: Association role : Association [UML]

With objects(s)
Player

In role
: Association role

Play a game links:


Link type
Graph's name
Decomposition none
Explosions
Ball Game behaviour - Design
View high scores: Use case [UML]
Properties:
Class name
Attributes [UML]
Operations [UML]
Documentation file
Extension points
Documentation

View high scores

Scores of the best games and stored automatically and the user can view top 10
list. The list includes scores and player names.

View high scores relationships:


In role
In relationship
: Association role : Association [UML]

With objects(s)
Player

In role
: Association role

256201502.doc
David Hill

View high scores links:


Link type
Graph's name
Decomposition none
Explosions
none

3.1.2015
27 (27)

S-ar putea să vă placă și