Skip to content

v0.5.0 — Blackjack rebuilt, Snake replicated

Choose a tag to compare

@Juliusolsson05 Juliusolsson05 released this 01 Aug 18:40
· 22 commits to main since this release

A ground-up rebuild of both games.

Blackjack — real 3D, rebuilt to spec

Rebuilt against docs/blackjack-spec.md. Three defects that survived five rounds of value-tweaking each had a specific technical cause:

  • Glare — EffectComposer renders to a HalfFloat target, and three.js forces NoToneMapping when rendering off-screen, so UnrealBloomPass was reading raw linear HDR. A threshold of 1.0 meant "brighter than mid-grey", which ordinary diffuse-lit white cards exceed. The composer is gone: direct-to-canvas keeps MSAA and correct tone mapping, glow is authored as additive sprites, vignette is CSS. Lighting is now calibrated so the brightest diffuse white lands at ~0.86 linear.
  • Blank cards — renderToStaticMarkup omits the xmlns a data: URI requires, so every card texture silently failed to decode. The first fix then produced duplicate width/height on self-sizing components — also a parse error, also silent.
  • Perspective — a 46° lens at 13 units. Now 30° at a computed ~25 units, 17° off vertical: near-orthographic bird's-eye, locked off, distance re-solved on every resize.

Also new: rounded card stock with face/back decals, a dealing shoe and discard tray whose fill tracks real shoe state, a discard sweep so rounds end instead of blinking out, payout chips pushed across the felt on a win, a bankroll chip rack that stows while a hand is in play, and pitch-jittered impact sounds owned by the scene (only it knows when a card lands).

Snake — a Google Snake replica

Full rewrite. The snake is no longer a row of squares but a single polyline stroked with round caps and joins, which yields the capsule body, rounded corner turns, and tapered tail for free. Smooth motion interpolates only the two ends of that polyline, so the body never wobbles through a turn.

Google's exact palette, 17×15 board, constant 125ms/step, turns buffered two deep so fast keypresses both land, and apple spawn that enumerates free cells rather than rejection-sampling (which degrades to an unbounded loop exactly when the board fills).

Compatibility

apiVersion 1, Tier-0 only — no permissions requested. Requires an Agent Code build that scales oversized modal extensions to fit the window; the games report a fixed 892×652 natural size.