Category: Lessons

  • Exercise 15

    Rainbows in a different colour mode void setup() { size(300, 300); background(#04B1CE); noFill(); colorMode(HSB); } void draw() { strokeWeight(random(3, 10)); stroke(random(255), 255, 255); // HSB Hue Saturation Brightness float rainbow_size = random(200, 270); ellipse(150, 350, rainbow_size, rainbow_size); }

  • Exercise 14

    Making Rainbows void setup() { size(300, 300); background(#04B1CE); noFill(); } void draw() { strokeWeight(random(3, 10)); stroke(random(255), random(255), random(255)); float rainbow_size = random(200, 270); ellipse(150, 350, rainbow_size, rainbow_size); }

  • Exercise 13

    Making Rainbows // initial position for our circle float circle_x = 300; float circle_y = 20; // how much to move the circle on each frame float move_x = 2; float move_y = -2; void setup() { size(400, 200); stroke(#D60DFF); strokeWeight(7); } void draw() { background(#21EA73); ellipse(circle_x, circle_y, 40, 40); circle_x = circle_x + move_x;…

  • Exercise 12

    moving our ball around float circle_x = 300; float circle_y = 20; void setup() { size(400, 200); stroke(#D60DFF); strokeWeight(7); } void draw() { background(#21EA73); ellipse(circle_x, circle_y, 40, 40); circle_x = circle_x – 2; circle_y = circle_y + 2; }

  • Exercise 11

    using random in a different way… float slow_circle_x = 0; float fast_circle_x = 0; void setup() { size(400,400); noStroke(); } void draw() { background(#1BB1F5); float slow_circle_size = 50; // what do you think this next line does? if(random(10) > 9) { slow_circle_size = 60; } fill(#C1FF3E); ellipse(slow_circle_x,50, slow_circle_size, slow_circle_size); slow_circle_x = slow_circle_x + 1; fill(#FF4800);…

  • Exercise 10

    // An introduction to a conditional float slow_circle_x = 0; float fast_circle_x = 0; void setup() { size(400,400); noStroke(); } void draw() { background(#1BB1F5); fill(#C1FF3E); ellipse(slow_circle_x,50, 50, 50); slow_circle_x = slow_circle_x + 1; fill(#FF4800); ellipse(fast_circle_x,50, 50, 50); fast_circle_x = fast_circle_x + 5; if(slow_circle_x > 400) { slow_circle_x = 0; } if(fast_circle_x > 400) { fast_circle_x…

  • Exercise 09

    // Animation Basics float circle_x = 0; void setup() { size(400,400); noStroke(); fill(#C1FF3E); } void draw() { background(#1BB1F5); ellipse(circle_x,50, 50, 50); circle_x = circle_x + 1; }

  • Exercise 08

    // white lines on black background // the lines begin on the top border and end on the bottom border // the lines must be vertical. void draw() { background(0); stroke(255); float distance_left = random(100); line(distance_left,0, distance_left,99); }

  • Assignment 1

    Instructions Create a new sketch file using Processing software Determine the size that you wish for the display window Create an intersting, original image for your own design using line(); and other associated codes Save the code and capture a picture of the output

  • Bonus Challenge 1

    try to replicate this painting.