xxxxxxxxxx
let circles = [];
let currentText = "INCEPTION";
let texts = ["INCEPTION", "REBORN"];
let textIndex = 0;
let lineWeight = 1;
function setup() {
createCanvas(500, 700);
for (let i = 0; i < 1000; i++) {
let x = random(width);
let y = random(height);
let diameter = random(20, 100);
circles.push({ x, y, diameter, speedX: random(-2, 2), speedY: random(-2, 2) });
}
setInterval(changeText, 1000);
setInterval(changeLineWeight, 500);
}
function draw() {
background(0); // Siyah arka plan
for (let i = 0; i < circles.length; i++) {
let circle = circles[i];
circle.x += circle.speedX;
circle.y += circle.speedY;
if (circle.x < 0 || circle.x > width) {
circle.speedX *= -1;
}
if (circle.y < 0 || circle.y > height) {
circle.speedY *= -1;
}
// Daire çizimi
noFill(); // İçi boş
stroke(255); // Beyaz çizgiler
strokeWeight(lineWeight);
ellipse(circle.x, circle.y, circle.diameter, circle.diameter);
}
// Metni çiz
textAlign(CENTER, CENTER);
textSize(75);
fill(0); // Beyaz renk
text(currentText, width / 2, height / 2);
}
function changeText() {
textIndex = (textIndex + 1) % texts.length;
currentText = texts[textIndex];
}
function changeLineWeight() {
// Çizgi kalınlığını değiştir
lineWeight = random(1, 2);
}
function keyPressed() {
// Klavye tuşuna basıldığında
if (key === 's') {
save('poster.jpg');
}
}