project 04

sketch.js

/*
Arden Wolf
Section B
ardenw@andrew.cmu.edu
Project-04
*/

function setup() {
    createCanvas(400, 300);
    background(0);
   
}

function draw() {
//curves
for(var i=10; i <200; i+=15) {
    stroke(13,238,255);
    line(i,20,320, i);
}

for(var i=20; i <400; i+=15) {
    stroke(13,238,255);
    line(200,i,i, 300);
}

for(var i=20; i <400; i+=15) {
    stroke(13,238,255);
    line(25,i,i, 275);
}

for(var i=20; i <400; i+=15) {
    stroke(13,238,255);
    line(25,i,i, 275);
    }

for(var i=10; i <700; i+=15) {
    stroke(13,238,255);
    line(i,100, 300,i);
    }



  var x = 0;
//red beams
    for (var i = 0; i < 50; i++) { 
    //for loop allows me to control the width of the beam of lines starting from a certain point 
        stroke(255, 0, 0);
        strokeWeight(1);
        line(300, 300, x, mouseY); //moves on mouse Y
}

//blue beams
var j = 1;
       for (var i = 4; i < 100; i++) { 
        j += 10;
        stroke (0, 0, 255);
        strokeWeight(2);
        line(300, 300, mouseX, 0);// moves on mouse x 
    }
//green beams
var w = 100;
       for (var i = 4; i < 200; i++) {
        stroke (0,255,0);
        strokeWeight(.5);
        line(400, 0, w, mouseY);//moves on mouse Y
    }
//yellow beams
var g = 100;
       for (var i = 5; i < 20; i++) {
        stroke (255,255,0);
        strokeWeight(.5);
        line(0, 0, mouseX, 275);// moves on mouse x 
    }
//purple beams
var m = 100;
       for (var i = 5; i < 50; i++) {
        stroke (252,141,255);
        strokeWeight(.5);
        line(25, 275, mouseX, mouseY);//moves on mouse Y and X
    }

//rect border
noFill();
stroke(255);
rect(20,20,355,255)

stroke(0);
strokeWeight (4);
rect(0,0,400,300);



}

I made my work look like laser beams at a concert. I used for loops to create the beams of lines together as well as the series of lines that created curves.

Leave a Reply