Processing Workshop 2: Generating Circles


In this task we got given an activity to use our Java knowledge from previous tutorials to make something speific happen when we cliked i nteh canvas. We needed to show 10 circles (of a random radius) at random psotions when the mouse was clicked. We learnt basic elements of code such as floats and the fill function. Trial and erro was used to firsly make 10 random circles appear on the canvas. The I worked out how to set the random psootion and radius of the circles. My last job was to set teh clearCanas fucntion so when the mouse was cliked the canvas refreshed and new circles appeared. To test myself I worked out how to chnage the colour of the circles to a random colour for every circle.

Screen Shot 2014-10-09 at 11.33.11 Screen Shot 2014-10-09 at 11.33.40Screen Shot 2014-10-09 at 11.36.51

From this code I could change the variables to add more circles or make the range of the radius larger so the circles would be smaller or larger.

Screen Shot 2014-10-09 at 11.45.06 Screen Shot 2014-10-09 at 11.45.09


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s