Unit 02 Games: Story Project #
๐จ Design Prompt: You will create a text-based game inspired by a real piece of media or your own life.
๐ป Your game must include one unique feature. For example:
It is totally up to you what type of story you make. For example you could make:
- choose your own adventure game
- exploration game
- puzzle game
- narrative story game
Zork is often noted as one of the best video games of all time.
“What Zork seemed to contribute more than anything was the idea that the computer could simulate a rich virtual environment” - Matt Barton
[0] Planning Document #
This is a big project with a lot of room for customization. It is important for you to plan the game prior to coding.
โ๏ธ Plan your game in the Canva document:
Unit 02: Games Project Planning Document
- Open the Link
- File > Make a Coopy
- Share with teacher
- Change name of file to include name
1๏ธโฃ outline your game overview
2๏ธโฃ outline your feature
3๏ธโฃ outline the feature implementation in the logic of the game
4๏ธโฃ outline the story in a graph diagram
๐ง Some idea for features:
- branches that come back together into the same Node
- ability to go back to a previous node
- some nodes send you back to the beginning
- time limit - user must make a choice quickly, OR ELSE
- auding audio or images to nodes
- variable messaging in the story associated with user actions
- e.g. “you have visited this store 5 times”
- a Player() class with unique properties
- e.g. hunger, money, or health
- adding enemies to the game
- certain nodes or parts of the story give you items
- e.g. a locked door where you need to first collect the key in a certain room.
[1] Set Up #
๐ป Start by going into your
unit02_games
folder.
cd ~/desktop/making_with_code/unit02_games
๐ป Clone your starter code.
Be sure to change yourgithubusername
to your actual Github username.
git clone https://github.com/the-isf-academy/project_game_story_yourgithubusername
cd project_game_story_yourgithubusername
poetry shell
poetry install
This repo includes the following files:
game.py
- when this program runs, it should launch your gameview.py
story_setup.py
model_story.py
model_node.py
README.md
- a brief description of your game
[2] Assessment #
โ This project will be assessed on the following criteria:
- Planning [3]
- I can consider the components of my game before coding
- I can create a UML diagram my feature with appropriate data types
- I can consider how to implement the feature into the game logic
- I can create a graph diagram to outline the branches of my story
- Iterative Development [3]
- I can track the development of my project by successfully committing to Github a minimum of each class work day, preferably after each work session
- I can write descriptive commit messages that accurately describe the changes made
- I can systematically break down my project into smaller chunks
- Feature Implementation [3]
- I can design and implement the necessary class(es) with appropriate properties and methods to fully realize my feature(s).
- I can write a feature that is well abstracted
- can be used in multiple scenarios within the game
- can be extended or adapted by another developer or student
- I can use descriptive names for modules, variables, classes, and methods to enhance code readability
- I can write descriptive comments to describe complex pieces of the code
- Game Implementation [3]
- I can test the game thoroughly to ensure the user interface behaves as expected and matches the Game Logic Flowchart
- I can implement a full functioning version of my graph diagram, ensuring all planned Nodes and connections are accurately represented
- I can design a
View
that is easily to read and understand - I can use descriptive names for modules, variables, classes, and methods
- I can write descriptive comments to describe complex pieces of the code
[3] Deliverables #
โกโจ
- A
Unit 02 Games Project: Planning Document
- A
project_game_story
repository will include some if not all the following files:
game.py
view.py
story_setup.py
model_story.py
model_node.py
README.md
- a brief description of your game๐ป Push your work to Github:
git status
git add -A
git status
git commit -m "your message goes here"
- be sure to customize this message, do not copy and paste this line
git push
[4] Resources #
๐พ Games for inspiration #
If you need inspiration, explore these narrative games. As you play, consider the different genres and what’s possible with this structure.
๐ Readability #
Here are a few resources that may help improve readability.
- Emojis
- InquirerPy
- This is the package that controls the menu
- Colorama
- This package adds colors to the print statements in the Terminal
๐ Play Sound #
If you are interested in including sounds in your game, follow along with these steps.
(0) Install the playsound library: pip3 install playsound
(1) Add a sound file to your repository. e.g. .mp3, .m4a, .wav file.
If will have multiple sounds, be sure to consider how you will organize your repostiory.
(2) Incorporate the sound into your game. If this is your feature, I highly planning how you will incorporate this into the Node()
, Story()
and/or game.py
.
from playsound import playsound
playsound('test_sound.m4a')
๐ Open Images #
If you are interested in including images in your game, follow along with these steps. It will open the image in your computer’s default image viewer (e.g. Preview).
(0) Install the playsound library: poetry add pillow
(1) Add a image file to your repository. e.g. .png, .jpg file
If will have multiple images, be sure to consider how you will organize your repository.
(2) Incorporate the image into your game. If this is your feature, I highly planning how you will incorporate this into the Node()
, Story()
and/or game.py
.
from PIL import Image
image1 = Image.open(r"test_img.png")
image1.show()
โฑ Time #
If you are interested in including an element of time in your game (a countdown, a stopwatch, etc.), follow along with these steps. You can also reference lab_typing_game
which used the time()
to calculate wpm.
Be sure to import the time library and any functions you want to use at the top of the file.
time()
- save the current time into a variable
from time import time
#save the current time
current_time = time()
sleep()
- pause your program for a given amount of seconds.
from time import sleep
#pause program for 3 seconds
sleep(3)
๐ ASCII Art #
ASCII Art is low-fi art that will print directly in the Terminal. For example…
|\ o
| \ o
|\ / .\ o
| | (
|/ \ /
| /
|/
๐ป The code for this looks like:
print("""\
|\ o
| \ o
|\ / .\ o
| | (
|/ \ /
| /
|/
""")
Note the
"""\
at the start and the"""
and the end of the print statement
๐ Here are a few links to find and create your own ascii art. Just be sure to site what you use in your README.md