gameState
string
Tracks whether the game is on the start screen ('start') or actively playing ('playing')—controls which code runs in draw()
let gameState = 'start';
player
object
Stores the player character's position (x, y), size (r), speed, carrying state, and velocity (vx, vy)
let player = { x: 200, y: 300, r: 18, speed: 4.2, carrying: null, vx: 0, vy: 0 };
bot
object
Stores the rival bot's position, size, speed, carrying state, AI target, and a timer for when it has no space in its base
let bot = { x: 200, y: 340, r: 18, speed: 2.5, carrying: null, target: null, noSpaceUntil: 0 };
brainrots
array
An array of all creatures currently on the map—each stores position, size, type, state flags (rescued, delivered, sold), income, and base slot assignment
let brainrots = [];
money
number
The player's total money earned by selling creatures and receiving rewards
let money = 0;
rescuedCount
number
The total number of creatures the player has ever rescued (shown on HUD)
let rescuedCount = 0;
showIndex
boolean
Controls whether the scrollable creature index panel is visible (toggled by pressing I)
let showIndex = false;
baseZone
object
Stores the position and size of the player's base zone (x, y, w, h)
let baseZone = { x: 0, y: 0, w: 220, h: 150 };
rarityValueRanges
object
Maps each rarity level (Common, Rare, Epic, etc.) to a min/max selling price range—used to randomize market values
const rarityValueRanges = { Common: [25, 1700], Rare: [2000, 9700], ... };
rarityIncome
object
Maps each rarity level to a default passive income per second—used if a creature type doesn't have a custom income
const rarityIncome = { Common: 1, Rare: 3, Epic: 7, ... };
brainrotTypes
array
An array of all possible creature types, each with a name, rarity, and computed values (income per second, market value)
const brainrotTypes = [ { name: 'Noobini Pizzanini', rarity: 'Common', ... }, ... ];
customIncome
object
Maps specific creature names to custom income-per-second values, overriding the rarity-based defaults
const customIncome = { 'Noobini Pizzanini': 10, 'Tim Cheese': 50, ... };