Skip to content

Josephine2244/PP3-Lost-In-The-Forest

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

53 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Lost In The Forest

Lost in the Forest is a text-based adventure game. The player must choose what direction to take to get passed any obstacles in their way as they try and make their way out of the forest.

View Live Project here

Table of Contents

User Stories

  • As a new user, I would like to be able to start the game easily.
  • As a new user, I would like the controls of the game to be easy to understand and follow.
  • As a new user, I would like to have multiple paths to take so the game is varied.

Features

Title

The title is displayed in a big font at the begninning of the game to draw the attention of the user.

Title

Add Name

The user adds their name at the beginning of the game to personalise the experience.

End Game graphics

End game input no

Multiple paths with different choices

There are two paths the user can choose from. Each come with their own challenges and choices along the way.

Colored text

Multiple colors are used to draw the attention of the player to important parts, e.g options, the riddle and the end of game.

  • coloredtext1
  • coloredtext2
  • coloredtext3

Future Features

  • Multiple difficulty levels
  • A choice of game locations

Typography and Color Scheme

  • A large font is used to display the title at the beginning of the game to capture the users attention.
  • Where users must input a choice to move forward, the options are presented in a green font so that they stand out to the user.
  • A blue font is used to display the riddle so that it is clear to the user that it is separate from the story narration of the game.

Flow Chart

flowchart-raw

Technology

  • Python
  • Github
  • CodeAnywhere
  • Heroku
  • Lucid Chart
  • Termcolor (ANSII color formatting installed in the workspace terminal)
  • Art (ASCII Art for game title installed in the workspace terminal)

Testing

PEP8 Python Validator Results

CI Python Linter Results

Test Cases

ID Test Subject Steps Taken Outcome Generated
01 Title Go to game and check appearance of title Title is legible and is of appropriate sizing
02 Start game story Check appearance and readability of the story Story is easy to understand and is legible. Options are shown in green
03 Input name Input name where prompted to do so Game handles input and will move to next scene if it is acceptable
04 Incorrect input name (empty) Attempt to proceed with empty name input Game will ask player to provide a valid name
05 First challenge story Check appearance of story Story is easy to understand and is legible
06 First challenge input 'left' Input 'left' where prompted to do so Input is accepted and leads to next scene (tree down)
07 First challenge input 'right' Input 'right' where prompted to do so Input is accepted and leads to next scene (cross bridge)
08 First challenge incorrect input Input incorrect value when prompted to choose an option Input rejected. Player prompted to input choice again
09 Cross bridge story Check appearance of story Story is easy to understand and is legible
10 Cross bridge input 'cross' Input 'cross' where prompted to do so Input is accepted and leads to next scene (meet troll)
11 Cross bridge input 'back' Input 'back' where prompted to do so Input is accepted and leads back to previous scene (first challenge)
12 Cross bridge incorrect input Input incorrect value when prompted to choose an option Input is rejected. Player prompted to input choice again
13 Tree down story Check appearance of story Story is easy to understand and is legible
14 Tree down input 'jump' Input 'jump' where prompted to do so Input is accepted and leads to next scene (meet goblin)
15 Tree down input 'back' Input 'back' where prompted to do so Input is accepted and leads back to previous scene (first challenge)
16 Tree down incorrect input Input incorrect value when prompted to choose an option Input is rejected. Player prompted to input choice again
17 Meet troll story Check appearance of story Story is easy to understand and is legible
18 Meet troll input 'speak' Input 'speak' where prompted to do so Input is accepted and leads to next scene (riddle)
19 Meet troll riddle Check appearance of riddle Riddle is easy to read and understand, appears in blue text
20 Meet troll riddle correct answer Input riddle answer where prompted to do so Input is accepted and leads to next scene (near end game)
21 Meet troll riddle incorrect answer Input incorrect value when prompted to choose an option Input is rejected. Player prompted to input choice again and is shown hints
22 Meet troll input 'fight' Input 'fight' where prompted to do so Input is accepted and leads to next scene (hit troll)
23 Meet troll incorrect input Input incorrect value when prompted to chooce an option Input is rejected. Player prompted to input choice again
24 Meet troll input 'hit' Input 'hit' where prompted to do so Input is accepted and leads to next scene (get chased)
25 Meet troll fight incorrect input Input incorrect value when prompted to choose an option Input is rejected. Player prompted to input choice again
26 Get chased story Check appearance of story Story is easy to understand and is legible
27 Get chased input 'run' Input 'run' where prompted to do so Input is accepted and leads to next scene (end game)
28 Get chased input 'hide' Input 'hide' where prompted to do so Input is accepted and leads to next scene (escape troll)
29 Get chased incorrect input Input incorrect value when prompted to choose an option Input is rejected. Player prompted to input choice again
30 Escape troll story Check appearance of story Story is easy to understand and is legible
31 Escape troll input 'run' Input 'run' where prompted to do so Input is accepted and leads to next scene (near end game)
32 Escape troll incorrect input Input incorrect value when prompted to choose an option Input is rejected. Player prompted to input choice again
33 Meet goblin story Check appearance of story Story is easy to understand and is legible
34 Meet goblin input 'give' Input 'give' where prompted to do so Input is accepted and leads to next scene (find map)
35 Meet goblin input 'fight' Input 'fight' where prompted to do so Input is accepted, fight story is easy to read and understand, and leads to next scene (find map)
36 Meet goblin incorrect input Input incorrect value when prompted to choose an option Input is rejected. Player prompted to input choice again
37 Find map story Check appearance of story Story is easy to understand and is legible
38 Find map input 'follow' Input 'follow' where prompted to do so Input is accepted and leads to next scene (end game)
39 Find map input 'ignore' Input 'ignore' where prompted to do so Input is accepted and leads to next scene (enter forest)
40 Find map incorrect input Input incorrect value when prompted to choose an option Input is rejected. Player prompted to input choice again
41 Enter forest story Check appearance of story Story is easy to understand and is legible
42 Enter forest input 'back' Input 'back' where prompted to do so Input is accepted and leads to next scene (find map)
43 Enter forest input 'continue Input 'continue' where prompted to do so Input is accepted and leads to next scene (exit forest)
44 Enter forest incorrect input Input incorrect value when prompted to choose an option Input is rejected. Player prompted to input choice again
45 Exit forest story Check appearance of story Story is easy to understand and is legible
46 Exit forest input 'run' Input 'run' where prompted to do so Input is accepted and leads to next scene (end game)
47 Exit forest incorrect input Input incorrect value when prompted to choose an option Input is rejected. Player prompted to input choice again
48 Near end game story Check appearance of story Story is easy to understand and is legible
49 Near end game input 'investigate' Input 'investigate' where prompted to do so Input is accepted and leads to next scene (end game)
50 Near end game input 'explore' Input 'explore' where prompted to do so Input is accepted and leads to next scene (first challenge)
51 Near end game incorrect input Input incorrect value when prompted to choose an option Input is rejected. Player prompted to input choice again
52 End game story Check appearance of story Story is easy to understand and is legible
53 End game play again input 'yes' Input 'yes' where prompted to do so Input is accepted and leads back to start game scene
54 End game play again input 'no' Input 'no' where prompted to do so Input is accepted and leads to end game screen
55 End game play again incorrect input Input incorrect value when prompted to choose an option Input is rejected. Player prompted to input choice again

01

Title

02

Start story

03

Name input

04

Name input incorrect

05

First Challenge story

06

First challenge input left

07

First challenge input right

08

First challenge input incorrect

09

Cross bridge story

10

Cross bridge input cross

11

Cross bridge input back

12

Cross bridge input incorrect

13

Tree down story

14

Tree down input jump

15

Tree down input back

16

Tree down input incorrect

17

Meet troll story

18 & 19

Meet troll riddle

20

Meet troll input answer

21

Meet troll riddle incorrect input

22

Meet troll input fight

23

Meet troll input incorrect

24

Meet troll input hit

25

Meet troll input hit incorrect

26

Get chased story

27

Get chased input run

28

Get chased input hide

29

Get chased input incorrect

30

Escape troll story

31

Escape troll input run

32

Escape troll input incorrect

33

Meet goblin story

34

Meet goblin input give

35

Meet goblin input fight

36

Meet goblin input incorrect

37

Find map story

38

Find map input follow

39

Find map input ignore

40

Find map input incorrect

41

Enter forest story

42

Enter forest input back

43

Enter forest input continue

44

Enter forest input incorrect

45

Exit forest story

46

Exit forest input run

47

Exit forest input incorrect

48

Near end game story

49

Near end game input investigate

50

Near end game input explore

51

Near end game incorrect input

52

End game story

53

End game input yes

54

End game input no

55

End game input incorrect

Fixed bugs

  • Game was not moving to next scene if input had to be re-entered. It was fixed by adding 'while true' to start of function and rearranging order of options in the function.
  • run.py file very long and lots of print statements. I created a new file to separate the story segments and keep the run.py functions simple and readable.
  • Lines to long in python code. Shortened const names and changed some statements into multiline statements.

Deployment

via CodeAnywhere

  1. Log into Codeanywhere.
  2. Go to workspace that was created for the project using link copied from Github.
  3. Open workspace and go to terminal at bottom of page.
  4. Type 'python3 run.py'
  5. The python code will begin running in the terminal.

via Heroku

  1. Log into Heroku.
  2. Create new app.
  3. Assign it a name.
  4. Go to settings tab.
  5. Add 2 buildpacks: heroku/python, heroku/nodejs.
  6. Ensure they are in this order. They can be dragged and dropped to change the order.
  7. In Config Vars, add Key: PORT, Value: 8000.
  8. Go to deploy tab and scroll down to 'Manual Deploy'.
  9. Select 'Main' branch and click 'Deploy Branch'.
  10. Once the app is built, a view button will appear.
  11. Click 'view' and the app will open in a new tab.

Forking project on Github

  • Open Github and login.
  • Go to the repository that you want forked.
  • The fork button on on the top right side across from the repository name.

Cloning project on Github

  • Open Github and login
  • Go to the repository you want to clone.
  • Click the blue 'Code' button and it will give three options of how to clone the repository (HTTPS/SSH/Github CLI).
  • Copy the URL
  • In a new terminal, change current directory to the location you want for the clone directory.
  • Type 'git clone' in the terminal followed by the URL you copied.

Credits

  • Instructions on adding colored text to terminal here
  • Instructions on installing termcolor here
  • Instructions on installing art here
  • My Mentor, Rohit, for all his advice throughout the project.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published