STATE_INSTALLING
number
A constant (0) that represents the first phase of the prank - the fake software installation screen
const STATE_INSTALLING = 0;
STATE_CRASHED
number
A constant (1) that represents the second phase of the prank - the blue screen crash
const STATE_CRASHED = 1;
STATE_REVEAL
number
A constant (2) that represents the third phase of the prank - the cheerful 'You've been pranked!' reveal
const STATE_REVEAL = 2;
currentState
number
Tracks which of the three states the prank is currently in - determines which drawing function runs each frame
let currentState = STATE_INSTALLING;
messages
array
An array of funny strings displayed one at a time during the installation phase to build suspense
let messages = ["Initializing prank subsystem...", "Compiling humor modules..."];
currentMessageIndex
number
Tracks which message from the messages array is currently being displayed - increments every 2 seconds
let currentMessageIndex = 0;
messageDisplayTime
number
How long each message displays on screen in milliseconds (2000 = 2 seconds) - can be tuned to speed up or slow down the installation
let messageDisplayTime = 2000;
lastMessageChangeTime
number
Stores the timestamp (in milliseconds) of when the last message was changed - used to calculate elapsed time
let lastMessageChangeTime = 0;
loadingProgress
number
A decimal value between 0 and 1 representing the fill percentage of the green loading bar
let loadingProgress = 0;
loadingSpeed
number
How much loadingProgress increases each frame (0.005 means very slow filling) - can be tuned
let loadingSpeed = 0.005;
crashDelay
number
How many milliseconds the blue crash screen displays before automatically transitioning to the reveal (3000 = 3 seconds) - can be tuned
let crashDelay = 3000;
crashStartTime
number
Stores the timestamp when the crash state begins - used to calculate how long the crash screen has been displayed
let crashStartTime = 0;
crashScreenColor
string
The hex color code for the blue screen background (#0000AA - classic blue screen of death color)
let crashScreenColor = '#0000AA';
crashScreenTextColor
string
The hex color code for text on the crash screen (#FFFFFF - white)
let crashScreenTextColor = '#FFFFFF';
revealColor
string
The hex color code for the background of the reveal screen (#FFD700 - gold/yellow) - creates cheerful contrast
let revealColor = '#FFD700';
revealTextColor
string
The hex color code for text on the reveal screen (#000000 - black) - visible on the gold background
let revealTextColor = '#000000';
loadingBarColor
string
The hex color code for the green progress bar (#00FF00 - bright green)
let loadingBarColor = '#00FF00';
messageColor
string
The hex color code for installation messages (#FFFFFF - white) - visible on black background
let messageColor = '#FFFFFF';
messageFontSize
number
Font size for the installation messages in pixels
let messageFontSize = 32;
crashFontSize
number
Font size for the crash screen messages in pixels
let crashFontSize = 24;
revealFontSize
number
Font size for the reveal screen messages in pixels - larger than other fonts to emphasize the punchline
let revealFontSize = 48;
revealAnimationSize
number
The current diameter of the pulsing circle in the reveal screen - grows and shrinks between 0 and 200 pixels
let revealAnimationSize = 0;
revealAnimationSpeed
number
How many pixels per frame the animation circle grows (positive) or shrinks (negative) - can be tuned
let revealAnimationSpeed = 5;