Code Toolkit: Python, Fall 2021

Week 3 — Wednesday, September 15 — Class notes

Review of last week

Homework review

Note, both of these code examples make use of this image file, so make sure to include this in the sketch folder if want to run this code, or, modify the image filename in the code example and use whatever other image you wish. (Thanks, Ashley, for sharing!)

Interaction

Adding interactivity with Processing

Please wait here!

Stretch break!

Interaction, continued

Please wait here!

If you've gotten this far before the rest of the class, wait here and maybe experiment by replacing line() with different draw primitives? What if you remove background() and draw lines from pmouseX,pmouseY to mouseX,mouseY where the color is determined by the distance between points?

Map