xxxxxxxxxx
103
//createCanvas(1125, 2436);
var y = 100;
var x = 100;
var m = -3;
var n = -5;
// The statements in the setup() function
// execute once when the program begins
function setup() {
createCanvas(1125, 2436); // Size must be the first statement
stroke('#acdbdf'); // couleurs des lignes
strokeWeight(10);
frameRate(30);
}
function draw() {
background('#010101'); //couleur du fond
y = y + (3*m);
if (y < 0) {
m = m*(-1);
}
if (y > height) {
m = m*(-1);
}
line(0, y, width/2, height/2);
line(width, y, width/2, height/2);
line(0, y, width/2, height);
line(width, y, width/2, height);
line(0, y, width/2, 0);
line(width, y, width/2, 0);
x = x + (3*n);
if (x < 0) {
n = n*(-1);
}
if (x>width) {
n = n*(-1);
}
line(0, height/2, x, 0);
line(0, height/2, x, height);
line(width/2, height/2, x, 0);
line(width/2, height/2, x, height);
line(width, height/2, x, 0);
line(width, height/2, x, height);
line(width, height/2, x, 0);
line(width, height/2, x, height);
line(width, height/2, x, 0);
line(width, height/2, x, height);
//grille de cercles
for (var a = 5; a < 1125; a = a+50){
for (var b = 5; b < 2436; b = b+50){
push();
translate(a, b);
drawCercles();
pop();
}
}
}
function drawCercles() {
noStroke();
fill('#69779b'); //couleur des cercles dans la grille
ellipse(0, 0, 10);
}
/*
function windowResized() {
createCanvas(1125, 2436);
stroke(255); // Set line drawing color to white
strokeWeight(50);
frameRate(30);
}
function mousePressed() {
m = m*(-1);
n = n*(-1);
}
*/