Ball Animation Lab
In this lab we are going to create 3 different ball animations.
[0] Set up
๐ป Go to your
cs9/unit00_drawing
folder.
cd ~/desktop/making_with_code/cs9/unit00_drawing/
git clone https://github.com/the-isf-academy/lab_ball_animation_yourGithubUsername
๐ป In the Terminal, type the following command to open the lab folder.Below you’ll see that the
git clone
command has ayourGithubUsername
.You need to replace this with your username
e.g.
https://github.com/the-isf-academy/lab_ball_animation_emmaqbrown
cd lab_ball_animation_yourGithubUsername
๐ป Enter the Poetry Shell to start the lab. As a reminder, we will run this command at the start of each lab, but only when we are inside a lab folder.
poetry shell
๐พ ๐ฌ Exiting the poetry shell
When you want to exit the shell, you can typeexit
or^D
๐ป Take a look at the files inside with:
ls
breathing_animation.py
movement_animation.py
color_animation.py
basic_shapes.py
helpers.py
settings.py
extension_animation.py
[1] Ball Animations
[Breathing]
๐ป Open the file:
breathing_animation.py
๐ป Try running the file:
python breathing_animation.py
. Currently, there is no animation. A purple ball just appears on the screen.
๐ป Change the code so the ball grows and shrinks. It should look like it’s “breathing”.

[Movement]
๐ป Open the file:
movement_animation.py
๐ป Try running the file:
python movement_animation.py
. Currently, there is no animation. A light blue ball just appears on the screen.
๐ป Change the code so the ball moves around the screen. It up to you to decide how it moves. It could:
- move up or down
- move up and down
- move diagonally
- move randomly

[Color]
๐ป Open the file:
color_animation.py
๐ป Try running the file:
python color_animation.py
. Currently, there is no animation. A green ball just appears against a yellow background on the screen.
๐ป Change the code so the ball changes in color. It up to you to decide how the color changes.
Note, the color is decided with RGB values as opposed to names of colors.
line 39
: changes the color mode to accept RGB values

[3] Deliverables
โกโจ For this lab, you should:
Once you’ve successfully completed the sequence be sure to fill out this Google form.
๐ป Push your work to Github:
- git status
- git add file_name.py file_name2.py
- git status
- git commit -m “describe your drawing and your process here”
be sure to customize this message, do not copy and paste this line
- git push
[4] Extension
๐ป Open the file:
extension_animation.py
in Atom. It is just an empty file.
๐ป Code a custom animation of your choosing! Here is an example of what you could create:
