Rudi Foodi renders everything with Three.js and WebGL. The scene graph, lights, camera, and all geometry are built entirely in JavaScript using Three.js primitives — there are no external 3D model files, no texture atlases, and no shader files. Every object from Rudi’s ears to the factory pipes of Level 10 is assembled from rawDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/mbeckham4-hub/Rudi-Foodi/llms.txt
Use this file to discover all available pages before exploring further.
BoxGeometry, ConeGeometry, CylinderGeometry, and SphereGeometry calls at startup.
Scene Setup
The renderer is created with antialiasing enabled and attached directly todocument.body:
makeRoom(level) is called with values from the current levelThemes entry:
180) and end distance (850) are fixed across all levels — only the fog color changes to match each sky.
Lighting
Two lights illuminate the world at all times:levelThemes entry carries a boolean sun flag. When makeRoom(level) runs, it shows or hides the directional light accordingly and compensates the hemisphere intensity to keep dark levels readable:
sun: false and rely entirely on the hemisphere light for illumination.
Camera
The camera is a standard perspective camera sized to the window:cameraYaw (horizontal rotation, updated by touch/mouse drag) and cameraPitch (vertical angle, clamped so the camera never flips). Every gameplay frame the camera position is recomputed from spherical coordinates and smoothly lerped:
cameraYaw and cameraPitch with sensitivity constants (0.008 horizontal, 0.006 vertical). The pitch is clamped between -1.2 and 1.05 radians to prevent the camera from passing through the ground or flipping over Rudi.
Geometry Builders
Three small helper functions create every piece of geometry in the game. They exist to eliminate boilerplate and ensure shadow casting is always enabled:mat() returns THREE.MeshStandardMaterial — not MeshLambertMaterial. The roughness default of 0.65 and metalness of 0.04 produce a slightly matte, slightly plastic look that reads well under the hemisphere + sun two-light rig.box() always uses an 8×8×8 segment count on BoxGeometry. This is higher than the Three.js default (1×1×1) and produces smoother shadow boundaries on animated geometry like Rudi’s body parts.
cone() enforces a minimum of 24 sides (Math.max(24, sides)). Cone primitives used with a low sides value (e.g., 4 for ears, 5 for the tail) intentionally produce angular, low-poly faceted shapes.
Rudi’s Model
makeRudi() returns a THREE.Group assembled entirely from box() and cone() calls. No textures are used — color alone distinguishes each part:
| Part | Primitive | Color |
|---|---|---|
| Body | box(2.8, 1.15, 1.25) | 0xf5f5f2 (off-white) |
| Side spot | box(1.15, 0.92, 0.22) | 0x111111 (black) |
| Chest | box(1.1, 0.95, 1.05) | 0xf5f5f2 |
| Head | box(1.25, 1, 1) | 0x101010 (near-black) |
| Face stripe | box(0.28, 0.82, 0.28) | 0xf8f8f8 (white) |
| Snout | box(0.72, 0.42, 0.52) | 0xf2f2f2 |
| Nose | box(0.16, 0.16, 0.2) | 0x000000 |
| Ears (×2) | cone(0.34, 0.95, …, 4) | 0x0d0d0d |
| Tail | cone(0.18, 0.95, …, 5) | 0xf5f5f5 |
| Legs (×4) | box(0.3, 0.95, 0.3) | 0xf1f1ef |
| Eyes (×2) | box(0.12, 0.12, 0.06) | 0xfaf6df |
| Pupils (×2) | box(0.05, 0.05, 0.03) | 0x111111 |
sides = 4 (square cross-section cone) and the tail uses sides = 5 (pentagonal), giving each a low-poly, almost origami appearance. The whole group is scaled (1.08, 1.38, 1.08) to make Rudi slightly tall and wide.
After construction, the game traverses the group once to collect references for animation:
userData.kind set at build time (e.g., leg.userData.kind = "leg").
Room Generation
makeRoom(level) is called at the start of every level. It first tears down the current room by removing every mesh that was tracked in the roomObjects array:
levelThemes entry (wrapping with modulo for levels beyond 20), applies the sky/fog/ground colors, and dispatches to a per-map block. All geometry is placed via addRoomMesh():
addRoomMesh is tracked in roomObjects[] so it can be fully cleared on the next level transition.
Map Types
The game ships with 20 named map types (one per level theme):map key | Description |
|---|---|
house | Four flat walls + furniture-like boxes |
maze | Rows of sinusoidal wall slabs |
islands | Scattered cylinders arranged in polar coordinates |
city | 50 random-height box “buildings” |
hills | 35 random cone mounds |
fort | Box towers ringing the perimeter |
temple | Four concentric rings of cylinder columns |
platforms | 36 floating box platforms in a spiral |
candy | Tilted cylinders (candy sticks) |
factory | Cylinder chimneys + conveyor-belt boxes |
craters | Sphere bumps scattered across the ground |
ship | A wide deck box with mast poles and a horizontal spar |
crystal | Tall random cones pointing upward |
kitchen | Counter boxes and an oversized appliance block |
arcade | 30 upright rectangular cabinet-like boxes |
jungle | Cylinder trunks each topped with a sphere canopy |
desert | Sand-dune cones |
clouds | Sphere clusters at varying heights |
pipes | Horizontal and vertical cylinder pipes crossing the room |
park | Box “benches” and sphere “bushes” |
accentMat cycles through 5 colors keyed on level % 5), so re-running a map type at a higher level will use a different highlight color.