This lesson shows how to bring together all 7 lessons and create a new sketch that synthesizes the parts of each sketch that I liked best. You will work similarly to use what you have learned, tutorials and examples on the Processing website to make a personalized project.
Start with a void setup()
void setup() {
size(600,600);
background(255);
}
The next section defines the "pen" and makes it capable of drawing. There is also a way to erase:
void draw() {
noStroke();
float circleSize = random(100);
fill(random(150,255));
if (mousePressed) ellipse(mouseX, mouseY, circleSize, circleSize);
if (keyPressed) background(255);
}
And then some code to save your work!
void keyPressed() {
println("Key was pressed!" + key);
if (key == 's') {
saveFrame("images/myImage-######.jpg");
println("Image saved! Hazzah.");
}
}
Now you get to take the rest of the time and pull together your favorite parts of the past lessons to create your own sketch. Make your project interactive, so we can play with it. Make it personal: use images that you make, not images you find on the internet. Make it magical: Processing can do amazing visual transformations and effects.
Your code must be commented to explain what each part does so just use the "//" and explain a little!
Remember you want to understand lines of code and be able to write them yourself so copying and pasting someone else's code should be avoided.