xxxxxxxxxx
126
let x
let j
let RB
let OLALAP
var C1RAND = 0;
var C2RAND = 255;
var typo;
var compteur = 0;
function preload(){
typo = loadFont("Compagnon-Medium.otf");
}
function setup() {
x = 0;
j = 1;
OLALAP = -25;
createCanvas(400, 400);
background(150); // couleur de fond
}
function draw() {
compteur ++; // compteur
background(150); // couleur de fond
RB = random(0, 255);
noStroke();
// elypse
strokeWeight(10);
stroke(255);
fill(C1RAND, C2RAND, 0);
ellipse(400,0,220,250);
// elypse 2
strokeWeight(10);
stroke(255);
fill(C2RAND, C1RAND, 0);
ellipse(400,400,600,540);
noStroke();
fill (255, 247, 0); // jaune
rect (x,0,50, 400);
// OLALA TEXTE
textSize(20);
textAlign(CENTER);
rotate(HALF_PI)
fill (0);
textFont(typo)
text ("OLALA L'ENCHAINEMENT", 200, OLALAP);
if (x < 350 & j == 1) {
x = x + 1;
}
if (x == 350 ) {
j = 2;
}
if (x > 0 & j == 2) {
x = x - 1;
}
if (x == 0 ) {
j = 1;
}
if (j == 1){
OLALAP = OLALAP-1
}
if (j == 2){
OLALAP = OLALAP+1.002
}
rotate(- HALF_PI)
fill (23, 222, 1); // vert
rect (0,100, 100);
fill (229, 17, 38); // rouge
rect (200,50, 100);
fill (20, 226, RB); // bleu
rect (150,250, 100);
fill (255);
rect (0 ,125, 400, 10); // x
fill (255);
rect (225 ,0, 10, 400); // y
textSize(50);
textAlign(LEFT);
textStyle(BOLD);
fill (RB, 0, 0);
textFont("Impact")
text ("ET VLAN !!!", 20, 370);
//structutre conditionelle
if( compteur == 60){
C1RAND = 255
C2RAND = 0
compteur = 0;
}
if(compteur ==30){
C1RAND = 0
C2RAND = 255
}
print(compteur);
textSize(100);
text(compteur, 15,95);
}