MoonLander Enhanced: Teaching an AI to Land on the Moon (and Other Things I Didn't Plan to Build)
A browser remake of the 1979 Atari Lunar Lander that turned into real orbital physics, historic Apollo missions, and an AI Theater where you watch a neural net learn to land in real time. Built with AI, for fun.
It started as a toy
I wanted something small and fun between heavier projects — a browser remake of the 1979 Atari Lunar Lander. Thrust, gravity, don’t crash. A weekend toy.
It did not stay a toy. MoonLander Enhanced is now a browser game with real lunar physics, a playable museum of historic Moon landings, and an “AI Theater” where you watch a neural network teach itself to land. It runs entirely in the browser — no install, no backend, no API keys for core play. And like everything I build lately, it was built with AI as my pair programmer, with me making the calls.
This is the build log: what it became, and what I learned letting a side project follow its own gravity.
Making the physics honest
The original arcade game cheats — it’s vibes, not physics. The first thing that pulled me in was making it real.
Gravity is the Moon’s actual 1.62 m/s². The lander is a rigid body: rotation carries momentum, so if you spin the craft and let go, it keeps spinning until you counter-burn. That meant modeling a separate RCS propellant tank for attitude control, distinct from your main descent fuel — burn all your RCS fighting a spin and you can’t straighten out for landing. Each mission has its own landing tolerances, and when you blow one the game tells you exactly how you died: come in too fast, too tilted, or still rotating and you get “SPINNING — STRUCTURAL FAILURE” instead of a generic explosion.
That one detail — naming the failure — changed how the game feels. You don’t just lose; you learn. I added a live ROT readout to the HUD that shades white → amber → red as you approach the rotation limit, so a spin-out is visible before it kills you. Honest physics plus honest feedback turned out to be the whole game.
A playable lunar museum
Once the physics were real, real missions became possible. There’s now a span of history you can fly, from 1966 to 2028: Luna 9 (the Soviet first soft landing), Apollo 11, 13, 15, and 17, and Artemis III. Each carries accurate fuel budgets, lander stats, and event-triggered radio chatter.
Apollo 13 doesn’t even have a landing — it’s the “Survive” loop-around, because that mission’s triumph was getting home, not getting down. Getting those details right meant a lot of reading, and a lot of asking my AI pair “is this actually how it worked?” and then verifying the answer rather than trusting it. (More on that below — it’s the whole discipline.)
There’s an Authentic Mode that flips on era-accurate hardware quirks: Apollo 11’s famous 1202 program alarm, the altitude blackout under 50 feet, a master-alarm cue, a DSKY-amber HUD. In Apollo era the landing-rotation gate tightens to 3–3.5°/s to match the real Lunar Module’s RCS deadband. Vanilla and authentic high scores are tracked separately, because they’re genuinely different games.
The part I’m actually proud of: AI Theater
Here’s where the side project stopped being about the Moon and started being about how learning works.
AI Theater lets you watch a reinforcement-learning agent — a Deep Q-Network — learn to land, live, at 50× speed. Early episodes are chaos: it slams into the regolith over and over. Then, somewhere around episode ten, it figures out that fuel is finite and the ground is fatal, and the landings start getting gentle. You can put a DQN, a policy-gradient agent, and a pure-random agent side by side and watch the difference between “learning” and “flailing.”
I tuned the agent until it got genuinely good fast: prioritized experience replay, an 11-dimensional state vector that includes vertical acceleration and ground proximity, and a quality-scaled landing reward. It now learns to land in roughly 15 episodes instead of 40–60. And the feature I like most: you can fork any episode — freeze the frame the AI is in, take the controls yourself, and try to beat it from that exact moment.
I am not a machine-learning specialist. I didn’t become one to build this. But I understood enough — with AI helping me go deep on the specific questions, exactly when I had them — to build a tool that makes reinforcement learning visible. That’s the generalist’s edge in one screen: you don’t need to be the expert, you need to know enough to make the thing real.
Everything else it grew
Side projects sprawl, and I let this one:
- Procedural, seeded terrain — the same seed produces the same map, so you can share a URL and race a friend on identical ground.
- Hazards — alien UFOs that siphon your fuel or reverse your controls, gravity storms that torque the lander, fuel leaks, and bits of “lunar archaeology” that surface Apollo-era trivia.
- A narrative campaign with two actual characters — Dr. Liam Hoshi for briefings and post-landing analysis, CapCom Maya Chen for in-flight callouts — with animated pixel-art portraits whose mouths move as they talk. Their silhouettes stay distinct so color-blind players can always tell them apart.
- Ghost replays, per-mission leaderboards, and shareable flight reports, all stored client-side in the browser.
Optional: drop in a Claude API key and the mission briefings and post-flight coaching become dynamic; leave it out and a rule-based version runs fully offline. Capability when you want it, nothing required.
What building it actually taught me
A few things this “toy” hammered home:
Honest models beat clever ones. The game got more fun the more accurately I simulated reality — momentum, finite RCS fuel, named failure modes. Faking it would have been less work and a worse game.
AI is a force multiplier, not a substitute for understanding. I leaned on my AI pair constantly — for the physics, the RL tuning, the Apollo history. But it’s confidently wrong often enough that the job was always to understand the thing well enough to catch it. The history especially: every “fact” got verified before it went in the game, because a museum that’s subtly wrong is worse than no museum.
Side projects are where you learn the things the day job doesn’t ask for. I picked up reinforcement learning, rigid-body physics, and WebGL rendering here — not because anyone needed me to, but because the project did, and shipping is how I learn.
It’s open source (MIT) and there’s more coming — a 3D cockpit mode and maybe peer-to-peer multiplayer are next. For now: go try to land on the Moon. Watch the rotation gauge. And if you crash, at least you’ll know exactly why.
More writing
A Lazy Sunday: Rebuilding My Site with AI and Leaving Wix Behind
How I went from a templated Wix site to an owned, fast, markdown-native stack — thought to design to a live cutover — in about a day, with AI as the pair programmer and me making the calls.
ReadSeven Months of Vibe Coding: How I Built a Privacy-First Journal App with an AI Pair Programmer
Building MoodHaven Journal from scratch as a non-developer — zero-knowledge encryption, a Wear OS companion, peer sync, and what it actually takes to learn while you ship.
ReadPro-AI, Eyes Open: What It Actually Does to Us, and How to Use It Well
I use AI every day and I'm genuinely optimistic about it. This is the honest version — what the research really says about AI and our brains, the environment, and the quiet ways it flatters us — and how I use it so it sharpens my thinking instead of replacing it.
Read