function drawBot() {
// Body (zombie-like dull green/gray)
fill(90, 110, 90); // Slightly darker dull green for body to contrast clothes
ellipse(0, 0, botSize * 1.2, botSize * 1.5); // Wider and taller than the head
// --- Clothing ---
// T-shirt (light blue)
fill(173, 216, 230); // Light blue
rect(-botSize * 0.6, -botSize * 0.6, botSize * 1.2, botSize * 0.8); // Main shirt body
rect(-botSize * 0.7, -botSize * 0.4, botSize * 0.2, botSize * 0.4); // Left sleeve
rect(botSize * 0.5, -botSize * 0.4, botSize * 0.2, botSize * 0.4); // Right sleeve
// Pants (dark blue)
fill(0, 0, 139); // Dark blue
rect(-botSize * 0.6, botSize * 0.2, botSize * 1.2, botSize * 0.55); // Main pants body
// Head (zombie-like dull green/gray)
fill(110, 130, 110); // Slightly lighter dull green
ellipse(0, -botSize * 0.4, botSize, botSize); // Positioned above the body
// --- Lagging Eye Tracking (for vacant stare) ---
let pupilSize = botSize * 0.08; // Smaller pupils for vacant stare
let eyeOffset = botSize * 0.2; // Distance of eyes from the center
// Calculate target pupil position based on mouse, but make it very subtle
// This global tracking makes its gaze slightly disconnected, adding to its stupidity.
let targetPupilX = map(mouseX, 0, width, -eyeOffset / 4, eyeOffset / 4); // Reduced range
let targetPupilY = map(mouseY, 0, height, -eyeOffset / 4, eyeOffset / 4); // Reduced range
targetPupilX = constrain(targetPupilX, -eyeOffset / 4, eyeOffset / 4);
targetPupilY = constrain(targetPupilY, -eyeOffset / 4, eyeOffset / 4);
currentPupilX = lerp(currentPupilX, targetPupilX, eyeLagFactor * 0.5); // Even slower lag
currentPupilY = lerp(currentPupilY, targetPupilY, eyeLagFactor * 0.5);
// --- Random Blinks ---
if (!blinking) {
if (blinkTimer <= 0) {
blinkTimer = floor(random(120, 360)); // Between 2 to 6 seconds at 60fps
}
blinkTimer--;
}
if (blinkTimer <= 0 && !blinking) {
blinking = true;
blinkTimer = blinkDuration;
}
if (blinking) {
blinkTimer--;
if (blinkTimer <= 0) {
blinking = false;
}
}
// Draw Eyes
// Left Eye
fill(255, 255, 200); // Sickly yellow-white eye background
ellipse(-eyeOffset, -botSize * 0.5, botSize * 0.4, botSize * 0.4); // White part of the eye
if (!blinking) {
fill(0); // Black pupil
ellipse(-eyeOffset + currentPupilX, -botSize * 0.5 + currentPupilY, pupilSize, pupilSize); // Pupil following mouse
} else {
// During blink, draw a thin black line
stroke(0);
strokeWeight(2);
line(-eyeOffset - botSize * 0.2, -botSize * 0.5, -eyeOffset + botSize * 0.2, -botSize * 0.5);
noStroke();
}
// Right Eye
fill(255, 255, 200); // Sickly yellow-white eye background
ellipse(eyeOffset, -botSize * 0.5, botSize * 0.4, botSize * 0.4);
if (!blinking) {
fill(0); // Black pupil
ellipse(eyeOffset + currentPupilX, -botSize * 0.5 + currentPupilY, pupilSize, pupilSize);
} else {
// During blink, draw a thin black line
stroke(0);
strokeWeight(2);
line(eyeOffset - botSize * 0.2, -botSize * 0.5, eyeOffset + botSize * 0.2, -botSize * 0.5);
noStroke();
}
// --- Vacant Mouth ---
fill(50); // Dark gray for mouth cavity
// A more open, slightly jagged mouth
arc(0, -botSize * 0.15, botSize * 0.7, botSize * 0.3, 0, PI);
// Add a small rectangle for a hanging tongue or just a darker patch
fill(150, 50, 50); // Dull red for a possible tongue
rect(-botSize * 0.1, -botSize * 0.1, botSize * 0.2, botSize * 0.1);
// --- Simple Zombie Scars/Patches ---
fill(80, 100, 80, 180); // Darker dull green, slightly transparent
rect(-botSize * 0.3, -botSize * 0.6, botSize * 0.15, botSize * 0.1); // Small scar on forehead
ellipse(botSize * 0.2, -botSize * 0.2, botSize * 0.1, botSize * 0.1); // Missing chunk on cheek
// Arms (simple black lines)
stroke(80, 100, 80); // Darker dull green for limbs
strokeWeight(5); // Set stroke thickness
// --- Awkward Twitching Arms/Legs ---
let armTwitch = sin(frameCount * 0.1) * 0.1; // Small oscillation for arms
let legTwitch = cos(frameCount * 0.08) * 0.05; // Small oscillation for legs
// Left arm (offset slightly)
line(-botSize * 0.8, 0 + armTwitch * botSize, -botSize * 0.4, botSize * 0.2 + armTwitch * botSize);
// Right arm (offset slightly)
line(botSize * 0.8, 0 - armTwitch * botSize, botSize * 0.4, botSize * 0.2 - armTwitch * botSize);
// Bot's legs are now dangling feet appropriate for a jockey
strokeWeight(3); // Thinner legs for dangling feet
line(-botSize * 0.2, botSize * 0.7, -botSize * 0.2 + legTwitch * botSize, botSize * 0.9); // Left dangling leg
line(botSize * 0.2, botSize * 0.7, botSize * 0.2 - legTwitch * botSize, botSize * 0.9); // Right dangling leg
noStroke(); // Reset stroke
}