# TODO 1: Put all your variable assignments here. # You should have no indentation here - i.e. no spaces # at the beginning of the line img = loadImage("3568.png") headradius = random (0,400) def setup(): # size() goes inside setup() here. Like this: size(600,600) # Optional: If your sketch from the previous part used background(), # put that here. It should have 4 spaces of indentation def draw(): # TODO 2: Put each of your variables here on their own line # and mark each as 'global'. (I will explain what this # means next week.) And assign each one a random value # using a low, high range that works reasonably within # your composition. You should have 4 spaces of indendation. # For example: # global treeHeight # treeHeight = random(50,250) global img global headradius headradius = random (0,400) # TODO 3: Now copy/paste all your draw code here (ie, the code # that uses those variables). All of the code here should # have 4 spaces of indentation. fill(70,176,255,10) circle(300,130,headradius) #head rect(171,268,274,235) #body rect(289,220,21,48) #neck fill(254,255,70,10) circle(244,119,headradius - 350) circle(324,115,headradius - 350) circle(130,122,14) circle(475,126,14) line(137,124,205,124) line(393,124,462,124) fill(70,255,142,10) triangle(208,505,237,536,260,505) triangle(341,505,364,536,394,505) # NOTE: If you are using background(), remove it for now, or move # it into the setup area, above. # TODO 4: Go through your code and for every place you are setting # a color, add some transparency. For example, if your code # has this: # fill(255,0,0) # modify it to something like this: # fill(255,0,0,10) # TODO 5: run your sketch and see what happens! # The idea here is that if you do the above, you should hopefully # get something that looks like the Idris Khan image compositions. # Do you? This is a lead-in to the topic for next week, and I will # explain more about it then.