Category: Lessons

  • Exercise 06

    // the lines begin on the left border and end on the right border // let’s make the lines be horizontal this time

  • Exercise 05

    // animation // white lines on black background // the lines begin on the left border and end on the right border void draw() { background(0,10); stroke(255); line(0,random(100), 99,random(100)); }

  • Coordinate System Quiz

    For the first sketch: “A black outlined square with a red horizontal line from the midpoint of the left side toward the middle of the right side.” For the second sketch: “A black outlined square with a red diagonal line from the lower left corner toward the upper right corner; and another red line from…

  • Exercise 04

    void setup() { background(0); // this makes the background black } void draw() { stroke(0, random(255), 0); // R, G, B // the screen is 100 pixels wide and 100 pixels tall // lines start at the middle of the screen (50, 50) line(50, 50, random(100), random(100) ); }

  • Exercise 03

    that wasn’t hard, try this; // use the menu File > Save to save your program // use the menu File > Load to load an existing program // setup() is called once at the start of the program void setup() { // framerate() tells processing how many times per second // it should execute…

  • Exercise 02

    that wasn’t hard, try this; // the draw() function is called many times per second // it’s very useful for animating objects // notice the opening and closing of curly braces // everything in between them is run many times per second void draw() { // background() erases the screen with a colour background(255, 204,…

  • Exercise 01

    Let’s start with something simple… // lines that begin with two slashes are comments for yourself // point() draws a pixel on the display point(50,50); point(51,50); point(52,50); point(53,50); point(54,50); point(55,50); // the first number is the X value (distance from the left border) // the second number is the Y value (distance from the top…