xxxxxxxxxx
43
let shine = [];
var x;
var n;
function setup() {
createCanvas(400, 400);
background(255, 255, 255);
// translucent stroke using alpha value
stroke(255, 204, 0);
}
function draw() {
// draw two random chords each frame
for (let i = 0; i < 300; i++) {
let i=new shiny();
shine.push(i);
}
}
class shiny {
constructor (xpos1,ypos1,xpos2,ypos2) {
// find a point on a circle
//translate(width/2,height/2);
//var n=0;
this.n = random(1, 2);
this.xpos1 =200+40 * sin(x++);
this.ypos1 =200+40 * sin(n);
// find another random point on the circle
this.xpos2 =200+80 * cos(n);
this.ypos2 =200+80 * sin(n);
}
show(){
line(xpos1,ypos1,xpos2,ypos2);
}
}