Original prompt
Write a complete, runnable Node.js program that serves an HTML5 Canvas game over HTTP implementing a Space Invaders-style arcade shooter. Draw a player ship at the bottom (move with LEFT/RIGHT arrows or A/D, fire with SPACE), a formation of alien enemies at the top that march side to side and drop toward the player when at the edge, and bullets that destroy enemies on contact. Show the current score, lives remaining, and wave number on screen at all times.
WAVES & ESCALATING DIFFICULTY (REQUIRED): The game must NOT end after a single wave. When all enemies in a wave are destroyed, automatically start the next wave within 3 seconds. Each successive wave must increase difficulty โ faster enemy movement, more rows of enemies, new formation patterns, or enemies that shoot back. Waves should escalate continuously so the game can be played indefinitely as an arcade loop. Display the current wave number prominently.
SCORING & PERSISTENT HIGH-SCORE BOARD (REQUIRED): The game MUST award points for gameplay actions and maintain a persistent high-score table. When a run finishes (player loses all lives), prompt the player to enter their name/initials (3 characters) and record it with the score. Save the top 5 scores (name + score) to a local JSON file in the working directory (e.g. high_scores.json), and also write the latest finished run as {"initials": name, "score": number} to /tmp/alpaca_score.json (overwrite it every run) so the arcade scoreboard can pick it up automatically, load and display them on startup and on the game-over screen, and write a new entry whenever a run finishes. Scores must survive restarting the program. Every new game MUST start with the score reset to 0 โ never carry over the previous game's score into the next session.
CREATIVITY: You are encouraged to add visual flair โ particle explosions, animated enemy sprites, starfield backgrounds, or other flourishes. The game must run top-to-bottom, start the HTTP server, and be immediately visible in a browser.
OUTPUT REQUIREMENT: Respond with ONLY the raw, runnable source code in a single fenced code block, with the first line starting at column 0 (no leading indentation). Do not include any thinking, explanation, summary, or prose before or after the code, and keep comments inside the code minimal.