xxxxxxxxxx
44
let circle;
function setup() {
ini = 100;
createCanvas(windowWidth, windowHeight);
angleMode(DEGREES);
colorMode(HSB, 100);
noFill();
strokeWeight(3);
frameRate(60);
input = createInput(ini, 'number');
input.size(40);
input.position(140, height-35);
input.input(numberChanged);
arr = [];
for(i = 0; i < ini; i++) {
arr.push(new Circle());
}
//yin = new YinYang(width/2, height/2, 50, 1);
}
function draw() {
background(5, 40);
for(i = 0; i < arr.length; i++) {
arr[i].show();
arr[i].update();
}
//yin.update();
//yin.show();
noStroke();
textSize(18);
fill(100);
text('Circle amount:', 20, height-20);
//text(yin.rSpeed, 20, 20);
}
function numberChanged() {
arr = [];
for(i = 0; i < this.value(); i++) {
arr.push(new Circle());
}
}