xxxxxxxxxx
//variables
var circleWidth = 200
var scircleWidth = 150
var cw3 = 100
var cw4 = 50
var cfloat = 10
//setups
function setup() {
createCanvas(1200, 1200);
background(000);
noLoop();
noStroke();
}
//Main draw
function draw() {
//1 Circle / lacivert
for (let i = 0; i < 10; i++ ) {
for (let j = 0; j < 10; j++ ) {
let x = i * circleWidth;
let y = j * circleWidth;
fill(0, 53, 102)
circle(x, y, circleWidth)
}
}
//2 Circle / beyaz
for (let i = 0; i < 10; i++ ) {
for (let j = 0; j < 10; j++ ) {
let x = i * circleWidth;
let y = j * circleWidth;
fill(255, 255, 255)
circle(x + cfloat, y + cfloat, scircleWidth)
}
}
//3 Circle / sarı
for (let i = 0; i < 10; i++ ) {
for (let j = 0; j < 10; j++ ) {
let x = i * circleWidth;
let y = j * circleWidth;
fill(255, 214, 10)
circle(x + cfloat*2, y + cfloat*2, cw3)
}
}
//4 Circle / siyah
for (let i = 0; i < 10; i++ ) {
for (let j = 0; j < 10; j++ ) {
let x = i * circleWidth;
let y = j * circleWidth;
fill(00)
circle(x + cfloat*3, y + cfloat*3, cw4)
}
}
}
//yer degistirme
function keyPressed() {
if ( key == 'k') {
rr = random (-30, 30)
cfloat = cfloat - rr;
draw();
}
}