More Animation Lab #
In this lab we are going to continue to experiment with SuperTurtle and exploring decomposition and abstraciton.
[0] Set Up #
๐ป Go to your
cs9/unit00_drawing folder.
cd ~/desktop/making_with_code/unit00_drawing/
git clone https://github.com/the-isf-academy/lab_more_superturtle_yourGithubUsername
๐ป In the Terminal, type the following command to open the lab folder.Below you’ll see that the
git clonecommand has ayourGithubUsername.You need to replace this with your username
e.g.
https://github.com/the-isf-academy/lab_more_superturtle_emmaqbrown
cd lab_more_superturtle_yourGithubUsername
๐ป Enter the Poetry Shell to start the lab. We will run this command at the start of each lab, but only when we are inside a lab folder.
poetry shell
๐ป This lab uses a package called SuperTurtle. To use SuperTurtle in this repo, we must install it using poetry.
poetry install
๐พ ๐ฌ Exiting the poetry shellWhen you want to exit the shell, you can type
exitor^D
๐ป Take a look at the files inside with:
ls
animation_tree.pyexperiment.pytree_parts.pyshapes.py
[1] Tree Animations #
This mini lab is designed to be a pick and choose adventure for practice animating with SuperTurtle.
๐พ ๐ฌ DocumentationFor lab, we recommend referencing the previous lab repository,
lab_superturtle, and the offical documentation.๐ SuperTurtle Documentation: superturtle.readthedocs.io/en/latest/animation.html
The offical documentation has a lot of information, so be sure to ask a teacher and experiment if you have any questions.
๐ป Let’s start by running animation_tree.py
python animation_tree.py

๐ป Take a look at the code with: code .
- The main animation loop is in
animation_tree.py. - It uses the
shapes.pyfile andtree_parts.pyfrom themoduleslab.
๐ป Fist, add a moon!
- Look in
shapes.pyfor a function you can use to draw the moon! - How will you move the moon across the screen?
- Reference the previous lab OR the documentation

๐ป Now move the moon!
- How can you use
translateto move the moon across the screen?

๐ป Edit the settings.py file. Add the abilty to easily customize the moon size and color
- How do you use variables from
settings.pyinanimation_tree.py?
TOTAL_FRAMES = 240
TREE_TOP_COLOR = (40, 112, 58)
TREE_TRUNK_COLOR = (100,40,0)
๐ป Now, create a forest of trees!
- You may keep the moon, or comment out the moon (
command + ?) - You will need to use
nested for loopsandfly()

[2] Deliverables #
โกโจ For this lab, you should:โ๏ธ At then end of class, be sure to fill out this Google form.
๐ป Push your code to Github
git statusgit add file.pygit statusgit commit -m "describe changes here"git push
[3] Experiment! #
๐ป In experiment.py, experiment by creating your own animation to create a new design using functions in shapes.py. We included the starter code from the
documentation, but feel free to delete it and start fresh!
A few ideas…
- a face with eyes that move
- a car that moves across the screen
- a llama with ears taht grow
๐ป Explore using the additional functions available to the animation transformations in
SuperTurtle. Experiment with:
debug = True?last_framecyclesrestore_state_when_finished()inmovementdashes,dots, andrainbowinstroke- the available
easingoptions