due: Tuesday, February 28, 8pm
setup() and draw()).
Create a composition using 2 separate loops, ie:
while conditional:
commands
while conditional:
commands
Use these two separate loops to create two different linear
repetitions. For example, a horizontal row and a vertical
column. What kinds of composition can you represent with this
structure?
Create a composition using 2 nested loops, ie:
while conditional:
while conditional:
commands
Use this to create reptition that is not just linear, but
two dimensional in some way. For example, maybe you could
make a grid. Not a sidewalk, but a checkerboard. Think
about the pattern of the nested loop structure and how it
causes you to think in this a way like: for each row,
create several columns. What kinds of imagery can you
represent with this structure?
lerpColor()). If
you add transparency to your color you can make really
interesting patterns if your shapes overlap.
line()
or arc(). Create a repeating pattern. Experiment
with using if statements inside your loop so that
the various iterations behave differently in some way.
Bonus (lead in to next week). Have a look at this sketch that implements the basics of a "Space Invaders"-type game:
Think about how you might use conditionals to check for collisions between the bullet and one of the aliens. Could you somehow mark an alien as "hit", so that after colliding with the bullet either it would disappear or change color? This is a trick question as it is technically not possible yet given what we've learned. It uses something that we will learn next week.
Try to write up some pseudocode that would describe how you would implement something like this.