✿ code toolkit ✿ python ✿

spring 2022 agenda

Week 4 — Homework assignment

Due: Wednesday, Feburary 23rd by 8pm

  1. Review this week's lecture notes.

  2. Conditionals and keyboard interaction. Create a composition that is dynamic and changing in discrete and discontinuous ways (unlike last week when you created dynamic interaction in smooth and continuous ways). You can start with your abstract interaction from last week (part 2) as a starting point, or you can create something totally new.

    Use conditionals (if statements) so that your sketch makes abrupt, non-continuous changes. Use conditionals with keyboard interaction so that the user can affect the behavior with key commands. Do you want these keyboard commands to be single presses? If so, use the new def keyPressed(): block. Do you want the keys to be held down? If so, use key inside a conditional in the def draw(): block.

  3. Making things move (on their own). Build on part 1 or start something new, but either way, please start a new Processing sketch. (If you're building on part 1, say File > Save As... and rename.) Add some elements to your composition that move on their own. Use conditionals to control this motion. For example, maybe your moving elements bounce off the walls of the draw window, or consider including a raster image as a background and create the effect that your moving elements are crossing a road, or through a pipe. Can you use keyboard interaction to influence the movement? For example to change speed, direction, or something else.

  4. Consider this an optional challenge if you're up for it. At this point, you have all the elements to implement something like basic game play. Can you create an object or character that the user controls with the keyboard, as well as one or more elements that move on their own, so that the character must touch or avoid the elements? You can use dist() (reference) to determine the distance between two x,y points — perhaps you can use this to determine if two elements have collided (if their distance is less than some amount).

  5. Begin reading Selections from Matthew Fuller's Software Studies: A Lexicon Read the following 5 sections: "Introduction", "Algorithm", "Code", "Programmability", and "Source Code". PLEASE NOTE: I have included several other chapters from this book in case you are curious. (All included chapters are indicated with highlighting in the table of contents.) They are all great, but you only need to consider the five mentioned above as the required sections for this reading. We will return to the "Data Visualization" chapter later in the semester.

    Your reading response is due two weeks from now on Tuesday March 1 at 8pm

** you will submit at least TWO files this week. if you decide to do the optional challenge (#4) you will submit three.**