Underground 2 Revived
Play Need for Speed: Underground 2 (2004) in Chrome and Firefox with WebGPU graphics, Web Audio, up to 120 fps widescreen, controller support, free roam and Online races with friends. Fan project, not
README 전체를 불러오는 중입니다. 아래는 저장된 발췌입니다.
NEON DUNGEON is a browser-first canvas roguelite. It ships as plain JavaScript
loaded by index.html: no bundler, no npm runtime packages, no build artifact.
Production index.html does load PostHog's hosted analytics script; telemetry
is routed through engine/telemetry.js and disclosed in privacy.html. The
codebase uses JSDoc plus // @ts-check for type safety and node:test for the
test suite.README 전문 보기 ↗NEON DUNGEON is a browser-first canvas roguelite. It ships as plain JavaScript
loaded by index.html: no bundler, no npm runtime packages, no build artifact.
Production index.html does load PostHog's hosted analytics script; telemetry
is routed through engine/telemetry.js and disclosed in privacy.html. The
codebase uses JSDoc plus // @ts-check for type safety and node:test for the
test suite.
npm ci
npm run check
To play locally, serve the repository with any static file server and open
index.html. Opening the file directly can work for quick visual checks, but a
local server is closer to GitHub Pages and service-worker behavior.
| Command | What it does |
|---|---|
npm test | Runs all tests/*.test.js files with Node's built-in test runner. |
npm run typecheck | Runs tsc --noEmit over test files that start with // @ts-check, then over all runtime code in src/ and engine/ (tsconfig.runtime.json, without Node types). |
npm run lint | Runs ESLint over the repository. |
npm run check:engine | Verifies engine/*.js stays free of NEON-specific content tokens. |
npm run check | Canonical gate: lint, typecheck, engine purity, then tests. |
Run npm run check before opening a PR.
npm test includes the golden oracle, tests/_game-sim.test.js. It plays
scripted journeys through the real game in Node and requires what they draw,
play, send, and save to match tests/golden/journeys.json. See the Tests
section of AGENTS.md for what it covers and the trace, diff, and update
commands.
The runtime is ordered script tags in index.html:
src/neon.js fail-loud dependency resolver, src/game-states.js
runtime state vocabulary, then early engine/*.js helpers: RNG, viewport,
audio, input, touch, draw, decor, particles, minimap.src/platform.js: browser/platform bridge and shared globals used by later
modules.src/content/terminals.js and
src/content/weapons.js, then final large runtime files: src/content.js,
src/entities.js, src/render.js, src/game.js.The script order is part of the architecture. Producers must appear before
consumers in index.html, and browser assets must be listed in sw.js so the
PWA cache can precache them.
For the detailed map, see docs/module-map.md. For the engine/game boundary,
see docs/engine-boundary.md.
| Area | Start here | Guardrails |
|---|---|---|
| Game flow, menus, save/resume, finale | src/game.js | tests/save.test.js, tests/seeded-generation.test.js, tests/mainframe-room.test.js |
| Player/enemies/combat simulation | src/entities.js | Combat and enemy-specific tests in tests/*.test.js |
| Weapons | src/content/weapons.js plus construction/use sites in src/content.js, src/entities.js, and src/game.js | Weapon-affix tests, tests/armory-reward-flow.test.js |
| Items, projectiles, dungeon generation | src/content.js | tests/projectile-wall-corner.test.js, seeded generation tests |
| Lore terminals | src/content/terminals.js plus placement in src/content.js | tests/lore-terminals-act1.test.js, narrative guardrail tests |
| Evaluation trials (logic / exploit / cooperation) | src/content/trials.js, placement in src/content/floor-generator.js, runtime deps in src/game.js getTrialDeps() | tests/trials.test.js, tests/floor-generator.test.js |
| Rendering, HUD, minimap, screen effects | src/render.js plus engine/draw.js, engine/minimap.js | HUD tests, tests/rendered-test-environment.test.js, tests/world-zoom.test.js |
| Browser platform, input, settings, touch, audio boot | src/platform.js | tests/touch.test.js, tests/settings-scale.test.js, tests/world-zoom.test.js |
| Persistent meta/progression | src/meta/save.js, src/meta/upgrades.js, src/meta/modules.js | tests/save.test.js, tests/modules.test.js, tests/cores.test.js |
| Static narrative/data | src/data/*.js, src/meta/intro.js, src/meta/logs.js, |
// @ts-check the first line of new .js files, before 'use strict'.CONTRIBUTING.md.index.html after its producers and before its
consumers.scripts/manifest.js and sw.js ASSETS.
tests/manifest.test.js fails if index.html, the manifest, and sw.js
drift. Do not add or bump a service-worker version number; sw.js uses a
stable cache name and network-first refresh for app assets.npm run check.Do not start with a broad TypeScript conversion or class-per-file rewrite. The current human-safe path is incremental extraction under the existing script-tag architecture:
// @ts-check;NEON.* surfaces and index.html load order;src/game.js as the coordinator until smaller seams are stable.See docs/refactor-roadmap.md for the recommended order.
main is stable and deployed by GitHub Pages.develop is the integration branch.anvil/<task-id>, feat/<name>, fix/<name>, or
docs/<name> and open PRs into develop.develop are squash-merged so integration history stays readable.develop target main; never target
main from feature/fix branches.develop to main uses rebase merge. Do not break the
release and versioning PR path or .github/workflows/release-version.yml.feat:, fix:, docs:, refactor:,
test:, chore:).GitHub Actions runs npm run check for PRs and pushes to main/develop.
GitHub Pages deploys from main.
src/meta/whispers.js| Narrative guardrail and data tests |