archive-defender
v0.1.2
Published
A twin-stick arcade game about reclaiming a runaway media archive.
Readme
Archive Defender is a twin-stick arcade game about stale media, runaway duplicates, and hostile sessions. It began as the hidden arcade inside Plex Librarian and is also available as an embeddable React package.
React package
The default component opens on its title screen, starts audio only after player interaction, saves
to archive-defender:save-v2, and pauses when the window loses focus or the page is hidden.
import { ArcadeGame } from "archive-defender";
import "archive-defender/style.css";
export function GamesPage() {
return <ArcadeGame onExit={() => navigate("/")} />;
}The package supports React 18.2 and React 19. Its stylesheet is self-contained and scoped beneath
.arcade-page; Tailwind CSS and DaisyUI are not required. Hosts can theme the game by setting
--archive-color-content, --archive-color-surface, --archive-color-primary, and
--archive-color-error on the component or an ancestor.
Hosts that launch the game from an existing user interaction can opt into an immediate session:
<ArcadeGame
startup="resume-or-new"
audioStart="immediate"
initialMode="normal"
initialWeapon="blaster"
persistence={{ key: "my-app:archive-defender" }}
onVictory={(summary) => recordWin(summary.score)}
/>;Available integration props include:
startup:"title","new-run","resume", or"resume-or-new".audioStart: browser-safe"interaction"or host-initiated"immediate".initialMode,initialWeapon, andinitialSettings.persistence:falseor an object with a customkeyand/orstorageimplementation.pauseOnBlurandpauseWhenHidden.onPhaseChange,onRunStart,onGameOver, andonVictorylifecycle callbacks.onExit,exitLabel, andclassNamehost UI integration.
Browsers may still reject immediate playback unless mounting follows a user gesture. Hosts can use
the archive-defender/launch helpers to prime the opening track during that gesture.
Controls
WASDor arrow keys to move; mouse to aim and fire.Shiftto dash,Spacefor Deep Scan,Rto reload, andEscapeto pause.- Touch controls are available on touch-capable devices.
Development
Archive Defender uses Deno 2, React, and Vite.
deno task verifyInstall the repository's Git hooks once after cloning:
deno task hooks:installCommits run formatting and lint checks. Pushes run the complete verification pipeline, including
type checks, tests, and both production builds. Hooks can still be bypassed with Git's --no-verify
escape hatch when deliberately needed.
License
Source code is available under the MIT License. Music and sound-effect credits are listed
in src/game/assets/README.md.
