Adding a new level to Rudi Foodi requires exactly two things: a new entry in theDocumentation 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.
levelThemes array that defines the color palette and map type, and a corresponding geometry block inside makeRoom() that builds the actual 3D room layout. Once both are in place, you can optionally bump MAX_LEVELS to extend the game and add a custom music theme. No other files or configuration need to change.
Step 1 — Add a Theme Entry
Open the file in a text editor
Open
rudi_low_poly_3_d_game 6.html in any text editor. The entire game lives in this single file.Find the levelThemes array
Search for
const levelThemes (around line 629). You’ll see an array of 20 objects, one per level, each defining a name, color palette, map identifier, and lighting flag.Step 2 — Add Map Geometry
Find themakeRoom(level) function by searching for function makeRoom. Inside it you’ll see a series of if (theme.map === "...") blocks, one per existing level. Add your own block at the end of that chain:
addRoomMesh(geometry, material, position, rotation?) sets castShadow and receiveShadow on the mesh, adds it to the scene, and registers it in roomObjects[] so it is automatically cleaned up when the next level loads.
Step 3 — Adjust MAX_LEVELS
Findconst MAX_LEVELS = 20 (near the top of the script block) and increment it to match your new total level count:
(level - 1) % array.length, so they wrap around automatically regardless of MAX_LEVELS. You only need to update MAX_LEVELS to make the game actually let players reach your new level rather than triggering the fly-away ending at the old cap.
Available Materials
InsidemakeRoom(), four material variables are already created from the current theme before any of the if blocks run. Use them freely in your geometry block:
| Variable | Source color | Purpose |
|---|---|---|
wallMat | theme.wall | Primary structural surfaces |
woodMat | theme.wood | Secondary structures, floors, trim |
darkWood | theme.dark | Dark accents, shadows, outlines |
accentMat | Rotates through 5 colors via level % 5 | Highlight geometry, obstacles |
Available Geometry
Use any of these Three.js geometry constructors. All geometry must go throughaddRoomMesh() — do not call scene.add() directly, or the objects won’t be cleaned up on level transition.
THREE.BoxGeometry(width, height, depth)— boxes, walls, platforms, cratesTHREE.CylinderGeometry(radiusTop, radiusBottom, height, segments)— columns, pipes, barrelsTHREE.ConeGeometry(radius, height, segments)— spikes, hills, treesTHREE.SphereGeometry(radius, widthSegments, heightSegments)— boulders, bubbles, orbs
addRoomMesh() is a rotation array [rx, ry, rz] in radians. For example, [Math.PI / 2, 0, 0] lays a cylinder on its side.
Tips
Optional — Add a Music Theme
ThemusicThemes array has 10 entries that cycle across all 20 levels via (level - 1) % musicThemes.length. To give your new level its own sound, add a new entry to musicThemes (search for const musicThemes):
[bass, pad1, pad2] in Hz. The melody array is a sequence of frequencies played over the chord progression. The speed value controls tempo. Once added, the new theme is picked up automatically by the modulo index — no other changes needed.