Você está na página 1de 13

Text Adventures 2015

Table of Contents
Introduction:.................................................................................................................................................. 2
Task-1 ........................................................................................................................................................... 3
The class diagram ..................................................................................................................................... 3
Task-2 ........................................................................................................................................................... 4
The activity diagram ................................................................................................................................. 4
Task-3 ........................................................................................................................................................... 5
Use case diagram ...................................................................................................................................... 5
Task-4 ........................................................................................................................................................... 6
Code Structure .......................................................................................................................................... 6
Program Testing ...................................................................................................................................... 10
Task-5 ......................................................................................................................................................... 13

L5DC September Page 1


Text Adventures 2015

Introduction: It is a text adventure game that was famous in the early days of home
computing. A player has to be commands to play this game. In this game, there are 4 rooms and
4 directions like east, west, south and north. A player can go any room by commanding and he
can pick up anything what are kept in rooms.

L5DC September Page 2


Text Adventures 2015

Task-1
There are 5 classes in my program. That is given below-

1. Input class,
2. Inventory class,
3. Item class,
4. Main class and
5. Room class.

The class diagram is given below-

Figure: Class Diagram

L5DC September Page 3


Text Adventures 2015

Task-2
The activity diagram is attached below-
start

Press N Dining Room.


Press S/W
Press N/W
Get Food/Water else

Press S Press W
Food/Water Not found

You cant go
that way
Drawing Room Library Room
Press E Press N Press N/W

Get Vast/ Flower else

Not found Get Book/Calender else


Vast/Flower
Book/Calender Not found

Press W Press S
Bath Room
Press S/W

Get Soap/ Facewash else


Not found
Soap/Facewash

Press S/E

END Game
Press Quit Anytime

Figure: Activity Diagram

L5DC September Page 4


Text Adventures 2015

Task-3
Use case diagram is given below-

Play Game

Give
instructions

Opportunity to extended Take Something


extended
take something Details

Select
Direction
extended
Change another
Player Game End
room

Select available
items

Figure: Use Case Diagram

L5DC September Page 5


Text Adventures 2015

Task-4

Code Structure
Screenshot for- Input class:

Screenshot for- Inventory class:

L5DC September Page 6


Text Adventures 2015
Screenshot for- Item class:

L5DC September Page 7


Text Adventures 2015
Screenshot for- Main class:

L5DC September Page 8


Text Adventures 2015
Screenshot for- Room class:

L5DC September Page 9


Text Adventures 2015

Program Testing
1. Program Running at Dining room-

2. Take which I see-

3. Error handling if again take this-

4. Error handling which is not available here-

L5DC September Page 10


Text Adventures 2015
5. Wrong direction to go another room-

6. Correct direction to go Drawing room-

7. To pick up vast from Drawing room-

L5DC September Page 11


Text Adventures 2015
8. To go Bathroom-

9. To go Library room-

10. End game-

L5DC September Page 12


Text Adventures 2015

Task-5
I have completed the implementation of the program successfully. The Program is in zip file
which is attached in CD.

Conclusion: The program is about text adventure game. I have tried to complete the program
thats why user can easily handle it. I faced some problems but our class lecturer Tasnuva Ali
helped me to overcome this problem.

L5DC September Page 13

Você também pode gostar