The example catalog — 75 raylib demos in jolt

A map of the whole suite. Each example is one namespace under src/net/b12n/raylib_jlt/, runnable by a friendly bb <name> task or the underlying joltc -M:<alias>. bb info prints this grouping live; this page adds the "how it's wired" recipe at the end.

Run one, list them, or reel through all of them:

bb <name>          # e.g. bb asteroids   (opens a window)
bb examples        # flat list with descriptions
bb info            # the grouped cheat-sheet below
bb run-all [secs]  # every example, N seconds each (unattended)

games (10)

previewbb nameshows
asteroidsthe classic vector shooter — rotate / thrust / fire, splitting asteroids
tetris10×20 well, 7 tetrominoes, rotation, line-clearing, levels
pongtwo-paddle classic, you (W/S) vs a ball-tracking CPU
vampire-survivorsauto-firing survivors-like — chasing waves, XP gems, leveling
snakethe classic snake (arrow keys, grow, don't crash)
breakoutpaddle + ball + brick grid (mouse paddle)
space-invadersmarching aliens (arrows + SPACE to shoot)
flappy-birdflap through the pipe gaps (SPACE)
game-20482048: 4x4 tile-merge puzzle (arrow keys)
minesweeperreveal/flag grid (mouse L reveal, R flag)

core (9)

previewbb nameshows
basic-windowthe minimal window + text (the default, joltc -M:run)
input-keysIsKeyDown, steer a ball with the arrow keys
input-mouseGetMouseX/Y, IsMouseButtonDown, click to recolor
input-mouse-wheelGetMouseWheelMove (a float return) scrolls a box
camera-2da 2D camera over a skyline — struct-by-value (see below)
delta-timeper-frame vs GetFrameTime movement
scissor-testBeginScissorMode clips a grid
basic-screen-managera LOGO / TITLE / GAMEPLAY / ENDING state flow
random-valuesGetRandomValue, a new value every 2s

shapes (32)

previewbb nameshows
bouncing-ballanimation, IsKeyPressed pause, DrawFPS
basic-shapesrect / circle / ellipse / line + an rlgl triangle
colors-paletteevery named raylib color in a grid
gradientDrawRectangleGradientV (two by-value Colors)
following-eyespupils track the mouse (scalar trig)
starfieldGetRandomValue + bulk draw, per-star twinkle
logo-raylibrectangles + text, positioned with MeasureText
mouse-traila fading cursor trail (alpha)
recursive-treea binary fractal tree (lines + trig)
math-sine-cosinea live unit-circle sine/cosine visualization
bullet-hella rotating bullet spiral
triangle-stripa rainbow strip via rlgl immediate mode
collision-areaAABB collision between two boxes (computed in Clojure)
dashed-linea dashed line follows the mouse
double-pendulumchaotic double-pendulum motion + trail
kaleidoscopestrokes mirrored with 6-fold symmetry
hilbert-curvea rainbow Hilbert space-filling curve
math-angle-rotationfixed spokes + a spinning line
ball-physics2D balls under gravity, SPACE respawns
lines-beziera cubic Bézier that follows the mouse
color-wheelan HSV color wheel drawn as an rlgl triangle fan (per-vertex hue)
pie-chartlabelled pie slices via rl/sector! + a legend
splinesCatmull-Rom / cubic-Bézier / uniform-B-spline through animated points (SPACE cycles)
vector-anglethe signed angle between two vectors, filled arc + degrees readout (atan2)
easingsa 3×4 grid of balls, each animating on a different easing curve
penrose-tilinga P3 Penrose rhombus tiling built by golden-ratio deflation
analog-clocka live analog clock (bezel ring!, ticks + hands line-ex!, libc local time)
digital-clocka seven-segment HH:MM:SS display (libc local time)
ring-drawingan animated annulus via rl/ring! + a stroked outline
rounded-rectanglerounded rectangles built from sector! corners + rects
rectangle-scalingdrag the bottom-right corner handle to resize a rectangle
lines-drawinga rotating fan of thick lines via rl/line-ex! (rlgl quads)

text (5)

previewbb nameshows
font-sizesfont sizes + MeasureText centering
writing-anima self-typing message
format-textformat padded score + MM:SS timer
words-alignmentalign a word inside a box with MeasureText
input-boxtype into a text box (GetCharPressed)

3d (12)

previewbb nameshows
camera-3dan orbiting 3D camera — Camera3D by value + rlgl cube
waving-cubes196 cubes rippling in 3D (shared rl/cube!)
camera-3d-first-personWASD + mouse-look walk through columns
tesseract-viewa rotating 4D hypercube projected 4D→3D→2D
wireframe-shapespyramid / octahedron / torus / helix as rlgl 3D lines
rlgl-solar-systemSun / Earth / Moon via the rlgl matrix stack
box-collisionsa player cube vs. boxes, 3D AABB highlight
rotating-cubea single cube spinning via the rlgl matrix stack
spinning-cubesa row of cubes each spinning with a phase offset
orthographic-projectionperspective vs orthographic (SPACE toggles)
point-cloud~1500 points as tiny rlgl cubes, rotating
bouncing-spheresspheres bouncing in a 3D box (rl/sphere!)

The 3D set stands entirely on two building blocks from rlgl-immediate-mode.md and struct-by-value-pointer-trick.md: with-camera-3d (the camera, by pointer) and cube! (the geometry, by rlgl vertices).

generative (7)

previewbb nameshows
game-of-lifeConway's Game of Life (SPACE reseeds)
boidsflocking birds (separation/alignment/cohesion)
fireworksrockets + fading particle bursts
fourier-epicyclesrotating circles trace a square wave
spirographanimated hypotrochoid roulette curves
l-systeman L-system fractal plant (grows + regrows)
flow-fieldparticles steered by a flow field (trails)

All seven are pure math + the drawing API — no new bindings. They showcase the suite as a generative-art canvas: cellular automata, agent flocking, particle systems, rotating-vector Fourier series, parametric roulette curves, string-rewrite fractals, and noise-steered flow fields.

Adding an example — the four touchpoints

The suite is deliberately mechanical to grow. One new example touches four places:

  1. Sourcesrc/net/b12n/raylib_jlt/<name>.clj, a namespace with a -main that runs the canonical loop (see headless-smoke-testing.md) against the net.b12n.raylib-jlt.raylib API.
  2. deps.edn alias:<name> {:main-opts ["-m" "net.b12n.raylib-jlt.<name>"]} so joltc -M:<name> works.
  3. check.clj require — add net.b12n.raylib-jlt.<name> to the :require list in net.b12n.raylib-jlt.check, so the headless compile-check covers it.
  4. bb.edn registry row — add ["<display-name>" "<alias>" "<group>" "<desc>"] to the examples vector and a matching bb <name> task, so it shows in bb info / bb examples / bb run-all.
    flowchart LR
      src["src/…/<name>.clj<br/>the example"] --> deps["deps.edn<br/>:<name> alias"]
      src --> chk["check.clj<br/>require (headless compile)"]
      src --> bb["bb.edn<br/>registry row + task"]
    

Filenames use underscores (basic_screen_manager.clj); the namespace uses hyphens (net.b12n.raylib-jlt.basic-screen-manager) — Clojure's standard file↔ns mapping.

One ordering rule applies inside every file: since jolt 0.4.0 an unresolved symbol is a compile error rather than a late-bound reference, so a definition must appear before its first use — in a fn body and in an :or destructuring default just as much as at top level. It bites hardest in the shared raylib.clj binding layer, where one misordered symbol stops every example from loading and only the first offender is reported. joltc -M:check is the quick confirmation; see the jolt note in the README.

See also