🔬 The FBI text is red, and the WARNING text is also red, but what color would you see if you added fill(255, 255, 0) (yellow) right before the WARNING text() call? Try it and see—the fill color only affects text drawn AFTER it.
fill(255, 0, 0); // Bright Red
textSize(min(width, height) * 0.1); // Responsive text size for the main title
text("FEDERAL BUREAU OF INVESTIGATION", width / 2, height * 0.2);
// Blinking WARNING text
// The text appears for the first half of every second (30 frames out of 60)
if (frameCount % 60 < 30) {
textSize(min(width, height) * 0.08); // Slightly smaller, still bold
text("WARNING", width / 2, height * 0.3);
🔬 The alarm pulses while WARNING is visible, then silences while it's hidden. What happens if you flip the condition—move the amp(alarmVolume) line to the else block and the amp(0) line to the if block? The alarm would sound when WARNING is hidden instead!
let alarmVolume = map(sin(frameCount * 0.2), -1, 1, 0.2, 0.7); // Volume pulses between 0.2 and 0.7
alarmOsc.amp(alarmVolume, 0.1); // Ramp to the new volume over 0.1 seconds
} else {
// --- Stop alarm when WARNING is not visible (during the "off" blink cycle) ---
alarmOsc.amp(0, 0.1); // Ramp volume down to 0 over 0.1 seconds
function draw() {
background(0); // Black background
// --- FBI WARNING Text ---
fill(255, 0, 0); // Bright Red
textSize(min(width, height) * 0.1); // Responsive text size for the main title
text("FEDERAL BUREAU OF INVESTIGATION", width / 2, height * 0.2);
// Blinking WARNING text
// The text appears for the first half of every second (30 frames out of 60)
if (frameCount % 60 < 30) {
textSize(min(width, height) * 0.08); // Slightly smaller, still bold
text("WARNING", width / 2, height * 0.3);
// --- Play alarm when WARNING is visible ---
// Create a pulsing volume for the alarm using sine wave
let alarmVolume = map(sin(frameCount * 0.2), -1, 1, 0.2, 0.7); // Volume pulses between 0.2 and 0.7
alarmOsc.amp(alarmVolume, 0.1); // Ramp to the new volume over 0.1 seconds
} else {
// --- Stop alarm when WARNING is not visible (during the "off" blink cycle) ---
alarmOsc.amp(0, 0.1); // Ramp volume down to 0 over 0.1 seconds
}
// --- Prank Message ---
fill(255); // White text
textSize(min(width, height) * 0.04); // Responsive text size for the message
text("Your device has been detected accessing unauthorized content.", width / 2, height * 0.45);
text("All data is being scanned and encrypted for forensic analysis.", width / 2, height * 0.52);
text("Do not close this window or disconnect from the internet.", width / 2, height * 0.59);
text("Failure to comply will result in further legal action.", width / 2, height * 0.66);
// --- Fake IP address and Tracking ---
fill(100, 255, 100); // Green text
textSize(min(width, height) * 0.03); // Smaller text for details
text("Tracking IP: 192.168.1.137 | Location: Unknown", width / 2, height * 0.8);
// --- Countdown Timer ---
// Calculates remaining seconds from 15, ensuring it doesn't go below 0
let countdownSeconds = 15 - floor(millis() / 1000);
countdownSeconds = max(0, countdownSeconds);
fill(255, 255, 0); // Yellow text
textSize(min(width, height) * 0.05); // Larger text for the countdown
text(`Time remaining until full encryption: ${countdownSeconds} seconds`, width / 2, height * 0.9);
// --- Escape Instruction ---
fill(200); // Light gray text
textSize(min(width, height) * 0.02); // Smallest text for instructions
text("Press 'Q' or 'Escape' to dismiss this prank.", width / 2, height * 0.96);
}