← Demo gallery · Previous: EXP-017 (original build)

EXP-018: Smaller Jolt Flappy Bird

The same EXP-017 game, rebuilt with Jolt 0.8.21. A browser adaptation of raylib-jlt’s Flappy Bird example. Jolt owns persistent state, physics, pipes, collision, scoring, restart behavior, and per-frame scene generation.

Updated upstream: built with unmodified Jolt 0.8.21 5b46858a. EXP-017 still uses signed-scalar defcfn only; the intervening FFI changes require no app rewrite. The matched native Chez cross host and EXP-018 size/changelog audit document the upgrade. Wasm is unchanged at 1,097,110 bytes; preloaded data is 15,728,775 bytes (40.0% smaller). The latest release default drops the unused compiler image; arbitrary browser eval is not included.

Play the embedded build

Press Space or click the canvas to flap. Fly the gold bird through the green pipe gaps.

Not loaded (17.3 MB total runtime assets).

What stayed in Jolt

Model

defonce game stores bird position/velocity, score, game-over state, and three pipe maps.

Update

Jolt executes gravity, flap, scrolling/recycling, pass scoring, collision, bounds, and restart every browser frame.

View

Jolt generates background, six pipe rectangles, bird circle, score, and optional game-over commands.

Minimal host

C only polls Space/click, calls the live Jolt frame! Var, interprets generic drawing commands, and owns Raylib scheduling.

Representative Jolt source

See the complete EXP-017 source and experiment report.

(defonce game (atom (new-game)))

(defn frame! []
  (let [flap? (= 1 (project-flap-pressed))
        st (if (:over? @game)
             (if flap? (new-game) @game)
             (step @game flap?))]
    (reset! game st)
    (upload-scene! (scene-commands st))))

;; step retains the source example's gravity/flap, pipe transforms,
;; pass scoring, collision, bounds, and game-over state transitions.

Verified EXP-018 result

Chromium capture of Jolt 0.8.21 Flappy Bird with blue sky, raised gold bird, green pipe gaps, and score 0.

Automation consumed both Space and left-click in the Jolt 0.8.21 build. The inspected capture shows nine commands, two flaps, a raised gold bird, green pipe gaps, and score 0. Browser isolation passed with no page or request errors. Artifact hashes.