← Public packages
@kentcdodds/roadster
Unofficial fan game: drive a stylized thruster roadster - launch 0-60, boost, hover, flip and hop over traffic.
AGENTS.md
23 lines · 2.5 KB · Markdown@kentcdodds/roadster: agent notes
Human overview: README.md.
- Package app.
kody.app.entryissrc/app.ts, which serves one HTML shell (src/page.ts) plus/health.kody.app.clientissrc/client/index.ts, bundled by the platform withthreefromdependencies. There is no CDN at runtime. src/app.tsmust never import the client graph. Besides the page and/health, it serves embedded images fromsrc/assets.ts:/og-image.jpg(1200x630 social preview) and/icons/favicon.svg,/icons/favicon-32.png,/icons/apple-touch-icon.png..kody/icon.pngis the package icon.- Social tags (og:*, twitter:card
summary_large_image) live inheadTagsinsrc/page.ts. og:image is absolute, built fromX-Forwarded-Host/HostpluspackageContext.appBasePath(fallbackhttps://kentcdodds.kody.run). - Images: edit files in
public/, then runnode scripts/embed-assets.mjsto regeneratesrc/assets.ts(generated, do not hand-edit). The og image is a real in-game render (headless Chrome + SwiftShader, HUD hidden, custom camera on the hovering car at sunset) with the title composited in HTML and screenshotted. - Client modules:
index.ts(loop, physics, challenges, HUD, input),car.ts(stylized car built from primitives),world.ts(map, ground height, canyon, ramp, lineup),audio.ts(WebAudio synth sound effects and music). - No secrets, credentials, storage, or outbound fetches. Saves live in browser
localStorage(roadster.save,roadster.sfx,roadster.music). - Keep it private. Kent decides whether to make it public. Keep it an unofficial fan game: no Tesla logos, wordmarks, or brand assets.
- The default export of
.(src/index.ts) returns the list of demo feats the game models.
Smoke tests
npx tsc --noEmitnpx @kodycodes/cli@latest dev, then open the URL. A test hook is exposed aswindow.__roadsterwithadvance(seconds, heldKeyCodes), a fixed-step simulation for frame-rate-independent tests, plusteleport(i),state, andsave.- Expected with
advance: after teleporting to 0 and callingadvance(3), the lights turn green. Thenadvance(1.3, ['KeyW','ShiftLeft'])records 0-60 in about 0.95 s. Tires only take about 2.3 s.
Edge cases
- Headless Chrome with SwiftShader renders at a low frame rate. Real-time key holds then move less than they would at 60 fps, so use
advancefor physics checks. - Landing with up.y < 0.55 or a vertical impact above 19 m/s counts as a wreck, and the car respawns at the last challenge spawn.