xxxxxxxxxx
// Excersise 3: Zev Shoag
// there are lots of colours and shapes, I hope you enjoy
let x = 0;
let y = 0;
function setup() {
createCanvas(windowWidth, windowHeight);
background(255,190,255);
}
function draw() {
//this is for the background checkerboard
colorMode(RGB);
while (x <=windowWidth && y <= windowHeight){
noStroke();
fill(random(255),random(255),random(255));
rect(x, y,10,10);
x = x+10;
if(x == windowWidth){
x= 0;
y = y+ 10;
}
}
}
function mouseClicked(){
let color = 0;
strokeWeight(3);
//for the black and white lines
for(let i=0;i<100000;i+=100){
if(color == 0){
color = 255;
}
else{
color = 0;
}
stroke(color);
line(width/2,height/2,width/2-i,height/2-200);
}
for(let i=0;i<100000;i+=100){
if(color == 0){
color = 255;
}
else{
color = 0;
}
stroke(color);
line(width/2,height/2,width/2+i,height/2-200);
}
for(let i=0;i<100000;i+=100){
if(color == 0){
color = 255;
}
else{
color = 0;
}
stroke(color);
line(width/2,height/2,width/2+i,height/2+200);
}
for(let i=0;i<100000;i+=100){
if(color == 0){
color = 255;
}
else{
color = 0;
}
stroke(color);
line(width/2,height/2,width/2-i,height/2+200);
}
}