xxxxxxxxxx
104
let monoFont;
function preload() {
monoFont = loadFont("terminal-grotesque-webfont.ttf");
}
function setup() {
createCanvas(400, 400);
textFont(monoFont);
textSize(28);
fill(255);
}
let time = 0;
function draw() {
drawZero();
if (time > 300) { // More rounds before resetting
time = 0;
}
}
function drawZero() {
background(0);
text("⌁", 200, 200);
time += 2.5;
let centerX = width / 2;
let centerY = height / 2;
// Different shades of yellow to be randomly applied to each character
const yellowShades = [color(255, 223, 0), color(255, 204, 0), color(255, 185, 0)];
while (time < 400) { // Increased range to create more rounds
if (time > 10) {
fill(random(yellowShades));
text("⌁", centerX, centerY - 50); // Larger movement
}
if (time > 20) {
fill(random(yellowShades));
text("⌁", centerX + 50, centerY - 50);
}
if (time > 30) {
fill(random(yellowShades));
text("⌁", centerX + 50, centerY);
}
if (time > 40) {
fill(random(yellowShades));
text("⌁", centerX + 50, centerY + 50);
}
if (time > 50) {
fill(random(yellowShades));
text("⌁", centerX, centerY + 50);
}
if (time > 60) {
fill(random(yellowShades));
text("⌁", centerX - 50, centerY + 50);
}
if (time > 70) {
fill(random(yellowShades));
text("⌁", centerX - 50, centerY);
}
if (time > 80) {
fill(random(yellowShades));
text("⌁", centerX - 50, centerY - 50);
}
if (time > 90) {
fill(random(yellowShades));
text("⌁", centerX, centerY - 100); // Extended range for movement
}
if (time > 100) {
fill(random(yellowShades));
text("⌁", centerX + 100, centerY - 100);
}
if (time > 110) {
fill(random(yellowShades));
text("⌁", centerX + 100, centerY);
}
if (time > 120) {
fill(random(yellowShades));
text("⌁", centerX + 100, centerY + 100);
}
if (time > 130) {
fill(random(yellowShades));
text("⌁", centerX, centerY + 100);
}
if (time > 140) {
fill(random(yellowShades));
text("⌁", centerX - 100, centerY + 100);
}
if (time > 150) {
fill(random(yellowShades));
text("⌁", centerX - 100, centerY);
}
if (time > 160) {
fill(random(yellowShades));
text("⌁", centerX - 100, centerY - 100);
}
return true; // Same logic, exit early to avoid the loop running endlessly
}
}