NUM_BUILDINGS
number
How many Building objects are generated across the skyline.
const NUM_BUILDINGS = 10;
NEON_CHANCE
number
Probability (0-1) that any given building is chosen to have neon signs.
const NEON_CHANCE = 0.6;
NUM_RAINDROPS
number
How many Raindrop objects exist and are recycled for the rain effect.
const NUM_RAINDROPS = 300;
RAIN_COLOR
array
RGBA values used to color every raindrop's streak.
const RAIN_COLOR = [100, 150, 200, 200];
RIPPLE_COLOR
array
RGBA values used to color the expanding ripple rings.
const RIPPLE_COLOR = [80, 130, 180, 150];
FOG_COLOR
array
RGB values used as the base tint for every fog layer.
const FOG_COLOR = [30, 30, 50];
NEON_COLORS
array
A palette of pink, cyan, and purple colors randomly assigned to neon signs.
const NEON_COLORS = [[255,0,100],[0,255,255],[150,0,255]];
LIGHTNING_INTERVAL
array
Min/max frame count used to randomize the delay between lightning flashes.
const LIGHTNING_INTERVAL = [300, 1000];
LIGHTNING_DURATION
array
Min/max frame count used to randomize how long each lightning flash lasts.
const LIGHTNING_DURATION = [5, 15];
REFLECTION_ALPHA
number
Base opacity used when drawing building and neon reflections on the street.
const REFLECTION_ALPHA = 80;
REFLECTION_BLUR_LINES
number
How many offset copies are drawn to fake a blurred reflection.
const REFLECTION_BLUR_LINES = 5;
FOG_LAYERS
number
How many FogLayer objects are created near the bottom of the screen.
const FOG_LAYERS = 3;
FOG_SPEED_RANGE
array
Min/max drift speed used when randomizing each fog layer's movement.
const FOG_SPEED_RANGE = [0.5, 1.5];
buildings
array
Stores every Building object currently in the scene.
let buildings = [];
neonSigns
array
Stores every NeonSign object attached to buildings.
let neonSigns = [];
raindrops
array
Stores every Raindrop object, continuously updated and recycled.
let raindrops = [];
ripples
array
Stores active Ripple objects created when raindrops hit the ground; removed once faded out.
let ripples = [];
fogLayers
array
Stores every FogLayer object drifting near the bottom of the screen.
let fogLayers = [];
windDirection
number
The current wind strength/direction, recalculated from mouseX each frame and used to tilt every raindrop.
let windDirection = 0;
lightningTimer
number
Countdown (in frames) until the next lightning flash begins.
let lightningTimer = 0;
lightningDuration
number
Countdown (in frames) for how much longer the current lightning flash lasts.
let lightningDuration = 0;
isLightning
boolean
Whether a lightning flash is currently active this frame.
let isLightning = false;
ambientSound
object
Reserved for an optional p5.sound rain noise generator (currently unused/commented out).
let ambientSound;