Since I missed James’s workshop this week, he sent me the annotated code that they had produced in the session.
The first sketch was an ellipse and a rectangle which changed size depending on which keys were pressed. Something I couldn’t understand however was why, when I pressed the ‘q’ ‘u’ and ‘e’ keys to change the size of the shapes, all previously drawn shapes would dissappear. I looked through the code for a line that might suggest, deletion of the old shape. But couldn’t find one. This didn’t make sense to me because in the code we wrote last week, the ellispes drawn by the mouse click stayed on the screen as new ones were drawn. It seems like this is just the nature of the programming language, or maybe that the mouse click is an essential factor here.
I think the main difference here might be that in last week’s sketch an ellipse is only drawn when the mouse is pressed but in the color_scroll, the shapes are drawn and then those same shapes change depending on the parameters set by the rest of the code.
I studied the code of colour_scroll and proceeded to write my own, instead of copying it word for word from the version that was given to me, I opened last week’s sketch to help me through the syntax. My end result was as follows: