Processing (Part 2)

The next programming workshop was a lot more complex then the first. We were set a task in the lesson to create 10 random circles that would randomly change colour and place when the mouse was clicked on Processing. The advice we were given was to not start by guessing how it would work but, to think about each step in order. This helped in completing the task and eventually I came to the result below:

Untitled-1

When the mouse was clicked the circles would randomly change position and colour.

Untitled-1

Untitled-2

  Here I just changed the number of circles from 10 to 100:

Untitled-3

Processing

For the first part of the lesson on programming we were introduced to a small amount of phrases that will be used throughout the next 3/4 years of our course. Such phrases included were: Variable, Parentheses, Integrated Development Environment (IDE), Functions, Methods, Class, Instant, Float, Loop, Complier, Conditional, Object Orientated Programming (OOP) and Camel case.

In the next part of the lesson we used a Processing to write lines of code. The code we created is shown below:

Untitled-1

1) When the code is run this is generated. When the mouse is moved ellipses are drawn.

Untitled-1

2) If the mouse is clicked where the x position is greater than 400 then the background is cleared

Untitled-1

3)  Else if the mouse is clicked where the x position is less than or equal to 200 the background is cleared and changed to a mid grey

Untitled-1