A neon, zero-gravity artillery duel for two players — think Worms meets Scorched Earth, wrapped in a synthwave sci-fi skin. Built as a single self-contained HTML file with real-time peer-to-peer multiplayer, no server, no backend, no install.
Play it live: zeekecc.github.io/novaduel
Two mechs face off across destructible terrain on opposite sides of the screen. On your turn, dial in an angle and power, launch your shot, and watch gravity and wind carry it toward your opponent. Direct hits and near-misses crater the ground and chip away HP. First mech to zero loses.
- 🎯 Turn-based artillery combat — classic angle/power/wind mechanics
- 🌌 Procedurally generated terrain — a new battlefield every round
- 💥 Destructible ground — craters persist and reshape the fight
- 🛰️ True peer-to-peer multiplayer — no game server, no lobby backend, no accounts
- ✨ Full canvas rendering — stars, nebulae, particle explosions, scanline FX
- 📱 Fills the whole browser window — no fixed layout, scales to any screen
The game runs entirely client-side in a single .html file. Two players connect directly to each other over WebRTC using PeerJS — one player hosts a match and gets a shareable room code, the other joins using that code. Once connected, the host's browser runs the authoritative physics simulation (terrain, projectiles, damage) and streams the results to the guest in real time.
No account system, no matchmaking server, no database — the two browsers talk directly to each other.
- Open the game in your browser.
- One player clicks Host Match and shares the generated room code with the other.
- The other player clicks Join Match, enters the code, and connects.
- Take turns aiming (angle/power) and firing — destroy your opponent's mech first.
Controls
| Player | Angle | Power | Fire |
|---|---|---|---|
| Player 1 (Host) | A / D |
W / S |
Space |
| Player 2 (Guest) | ← / → |
↑ / ↓ |
Enter |
You can also use the on-screen sliders and Launch button. Firing is only enabled on your turn.
Because the game uses WebRTC, it needs to be served over http(s):// — opening the file directly via file:// will break peer connections (browsers treat local files as isolated origins). To run locally:
# Python
python -m http.server 8000
# or Node
npx serve -l 8000Then visit http://localhost:8000/nova_duel_online.html.
WebRTC connections between two different networks (e.g. two players in different homes) sometimes can't establish a direct path due to NAT/firewalls, and need a TURN relay server as a fallback. This project fetches short-lived TURN credentials from a small Cloudflare Worker at connect-time, rather than embedding secrets in the client. See the Wiki for setup details if you're self-hosting.
- Vanilla JavaScript, no build step, no framework
- HTML5 Canvas for all rendering
- PeerJS (WebRTC wrapper) for peer-to-peer networking
- Cloudflare Realtime TURN + a Cloudflare Worker for cross-network relay credentials
More detail — architecture notes, networking internals, and troubleshooting — lives on the Wiki.
MIT — see LICENSE.