Audited every non-adventure game in the jefehz.org arcade — 40+ game files across 5 categories. Found 3 invisible games (wrong registration API), 6 crash bugs, an arcade system that couldn't launch anything, and 12 trademarked game names that needed scrubbing. Two sessions, 16+ files changed, 456 lines added, 402 deleted. Every game in the collection now loads, plays, and uses original naming.
Animal Checkers: Three Bugs, One Broken Board
Checkers "used to work" but a prior commit left debug code active. hasMandatoryCaptures() fired a showFloatingMessage("DEBUG...") on every call — which happens on piece selection, move attempts, win checks, and AI calculation. The guard had || true so it always fired. Second bug: selectPiece() cleared square backgrounds with backgroundColor = '', but the board uses inline cssText backgrounds — wiping them turned squares transparent. Third: clicking an enemy piece directly gave zero feedback instead of explaining you need to click the landing square. All three fixed. Built 30 Jest unit tests covering the checkers logic as a regression net.
Three Invisible Games
Pac-Pets, Asteroids Pets, and Sea Invaders all called MinigameEngine.register() — which doesn't exist. The correct API is MinigameEngine.registry.register(key, obj). These games loaded silently, registered with nothing, and never appeared in the game list. Fixed all three and also replaced two "Under Construction" placeholder loaders that were hiding real, working game files behind them.
Crash Fixes Across the Board
| Game | Bug | Fix |
|---|---|---|
| Drug Wars, Sopwith, Pet Pilot | location.reload() on Play Again destroys entire page | Replaced with loadMinigame(key) |
| Petris | Counter-clockwise rotation used negative loop count | Normalized with ((times % 4) + 4) % 4 |
| Block Drop Classic | Play Again called window.tetrisGame.resetGame() — undefined | Store instance in window.tetrisGame via MinigameEngine init |
| Word Games | Correct anagram answer called nonexistent generateNewAnagram() | Replaced with this.startAnagrams() |
| Solitaire | Zero click handlers — cards rendered but unmovable | Added full click-to-move with selection, validation, multi-card moves, auto-flip, double-click-to-foundation |
Arcade System Rewrite
arcade.html loaded games into a hidden temp container, called loadMinigame(), waited 500ms, then transferred the result via innerHTML into an ArcadeMachine overlay. This killed every event listener, canvas context, and animation frame — games were dead on arrival. The page also overrode document.createElement and Element.prototype.appendChild to block panel UI, which broke game rendering too. Rewrote the launcher to render games directly into #game-content, removed the ArcadeMachine overlay (arcade.html is the arcade), removed all DOM method overrides, and tamed the cleanup interval from 100ms nuclear to 2s targeted.
Save System & Lifecycle Fixes
Analyzed all games for save relevance. Most are session-based (action, puzzle, card) and already persist high scores via localStorage — no changes needed. Drug Wars is the exception: a 30-turn economic strategy game that lost all progress on navigate. Added save/load with localStorage persistence, auto-clear on game end. Also added the missing cleanup() and getState() to Cat Café — its auto-generation interval leaked on every game switch.
Copyright Scrub
Found 12 games still using trademarked names in filenames, display titles, registry keys, CSS classes, and localStorage keys. Previous rename effort created alternative files (pet-crossing.js, pet-muncher.js, etc.) but didn't finish — old files persisted and internal references still said the originals. Systematically renamed everything to original titles: Bomberman→Pet Bombers, Pac-Man→Pet Muncher, Frogger→Pet Crossing, Tetris→Petris/Block Drop, and 8 more. Removed orphaned trademarked-name files where renamed alternatives exist.
Final Stats
30 files modified, 750 lines inserted, 696 deleted. 30 Jest unit tests for checkers logic all passing. Every non-adventure game in the collection now loads, plays, saves where appropriate, and uses original naming.
What's Next
- Remaining medium-priority bug: Pet Pilot oil spill permanently reduces speed with no recovery
- Adventure game collection is untouched — queued for a future session
- Test infrastructure in place (Jest + jsdom) — expand coverage beyond checkers to other game logic
- Solitaire could benefit from undo and a better hint system