Building an electromechanical Lunar Lander game had been on my ‘to-do’ list for a while, and I finally got the motivation to make it happen for the 2016 NYCResistor Interactive show. Deadlines can be wonderful motivators, and I usually wind up finishing at least one fun project a year when the Interactive Show rolls around. This project was somewhat-inspired by seeing the fantastic ‘Video Sans-Video Game’ at NYC’s Maker Faire a few years ago, which was beautiful in its simplicity and the effect that it achieves.
Fleshing Out the Idea
This game is meant to have more-or-less the same mechanics as the original arcade game. You start out in orbit around the moon, and the goal is to guide your craft down to a gentle landing. I played around with a few different ideas that didn’t quite make the cut:
– An ultra-simple ‘2D’ moon cut out of a flat sheet of acryllic, which rotates beneath the ship
– A square 3D landscape (like this version), with the ability of the craft to move in X-Y
– A full spherical moon that could be rotated in 2 directions (which would have been awesome, but I still don’t even know if this is mechanically possible with a ‘lumpy’ moon)
My initial concept for this had been the ‘2D’ option, but I went with a ‘psuedo-3D’ sphere at the behest of my wife, who both helped out with this project and generally has a better aesthetic sense than I do. It has the same mechanics as the 2D moon (it rotates on a single, central axis), but makes the whole game look much more interesting.
As I mentioned earlier, the general goal of this project was to recreate the feel of the arcade game as much as possible. The spaceship is effectively in a fixed orbit along the moon’s equator, and the elevation of the spaceship is controlled by a linear stepper motor that moves the ship closer or further from the moon’s surface. A servo lets you orient the ship so that you can control the thrust direction, just like in the arcade game. The moon’s surface is properly ‘lumpy,’ in order to make landing an interesting challenge, and to make the game mechanically simpler, the moon rotates underneath the spaceship rather than having the spaceship rotate around the moon.
Building the Moon
As I mentioned above, I was going for a certain ‘lumpy’ aesthetic with the moon (which is also essential for interesting game play), and I think I achieved it. The moon began life as a “Hello Kitty” kickball on sale for $3 at a CVS around the corner from my house. We then very messily coated it in a couple layers of paper-mache, adding moon-like features (craters, mountains, etc. – Slartibartfast would be proud) as we went to make it interesting. Paper-mache is a great medium to work with that’s really under-appreciated in the hacker community =)
The moon was attached to the drive motor using hot glue and a 3D-printed coupling widget designed for the purpose. Having your mechanical load pushing down directly on your motor shaft isn’t great engineering practice, but this thing had to run for approximately 4 hours (and the ball is light), so it worked out fine.
Our moon making its first wobbly rotation! *sniff*
For paint, we purchased two cheapo acrylic paint sets at the aforementioned CVS. When it became clear that the included black and white paint tubes were woefully insufficient for properly coating the whole moon, we relaxed our aesthetic standards and went with the ‘use whatever color isn’t empty yet’ approach. All in all I was pretty satisfied with how it turned out.
The spaceship was 3D printed, and designed to look vaguely like the lunar lander in the game (and in real life, I guess), while still leaving room to be festooned with sensor switches. The Lander rides back and forth on a 3D-printed ‘carriage’ driven by the linear stepper motor, and is attached to a hobby servo motor that lets you orient the craft. Once again, hot glue was used to physically attach everything. I really can’t emphasize enough how well hot glue works for attaching objects on short notice. A glue gun should be part of everyone’s toolbox.
A Lunar Lander in its natural habitat
The spaceship has three switches – two side-mounted collision sensors with semi-circular bumpers and a landing-gear sensor on the bottom. To win, the player needs to avoid triggering the collision sensors, and only trigger the landing gear sensor when the ship’s descent speed is below a certain threshold value. The threshold was adjusted to make it possible-but-not-easy to win (particularly as the night wore on and adult beverages were consumed).
The Lander ready to descend
The player’s controls for this game are pretty simple (even in the original arcade game) – just turn left/right and thrust. The only tricky part is making it simple and mechanically robust so that it can hold up to some abuse.
Like most of this project, the control box was mostly cobbled together from stuff lying around my basement. A satisfyingly-large momentary-switch was used for the start/thrust button, and a joystick was built using a combination of 3D printing and aluminum extrusion. The joystick is mounted on a bearing so that it can rock back and forth, and micro-switches on either side of the slot detect if the ship should rotate left or right.
A peek under the hood
The control electronics for this aren’t terribly interesting – it’s a pretty standard Arduino project. The Arduino reads all of the switches (3 for the ship, 3 for the control box, and a limit switch for the linear stepper), and drives the linear stepper and servo for the ship, the DC motor for the moon, and a 12V buzzer for sound effects. A motor-driver shield I had lying around drives the latter two, and the former all connect directly to the arduino with a custom prototyping-shield. The buzzer had been sitting around in my toolbox for the better part of a decade, so I was delighted to actually find a use for it – and the warbly sounds it generates fit right in with the rest of the game.
The astute observer may have noticed that this project, like much of my previous work, has been cobbled together largely from the near-infinite supply of surplus Makerbot innards that occupy both my basement and the shelves of NYCResistor. The DC motor that drives the moon is an extruder motor from a Makerbot Cupcake CNC, the linear stepper is from the z-stage of a Thing-o-Matic (along with a Makerbot Stepper Driver to control it), the Arduino is an Atmega 2560, also from a Thing-o-Matic, and the sensor switches (used in the joystick, the spaceship and as a limit-switch on the stepper) are the limit switches that all of the Makerbots use.
Software and Game Logic
As I said, this is a pretty standard arduino project – monitor some inputs, drive some outputs, maintain a little bit of state. The fun part of this was working with the minimalist I/O to come up with an interface that could be used intuitively by progressively more intoxicated people as the night wore on. The game starts out in ‘screensaver’ mode, with the spaceship pointed sideways and at its maximum elevation, orbiting the moon at maximum orbital velocity. If the user presses the big ‘thrust/start’ button, the game begins. After a few informative chirps from the speaker, it’s now in the hands of the player to safely navigate to the surface. First, the user needs to kill their horizontal velocity by pointing opposite the direction of motion and thrusting (this is how real orbital mechanics work, but it turns out that telling most people that “it works just like normal orbital mechanics!” isn’t terribly useful for them), while counteracting the constant pull of gravity. There are only a few locations on the moon that are flat enough to land without risking triggering a side collision, so the goal is to maintain sufficient elevation that you avoid any mountain impacts, while slowing down such that you lose all horizontal velocity above a nice flat patch (the crater works well for this!). With the thruster pointed straight down, you need to very carefully counteract your downward acceleration so that you land with almost no vertical velocity. If you succeed, your ship will lift off and perform a ‘Waggle of Victory’ while festive warbles are emitted from the speaker, before eventually returning to orbit. If you fail (either by triggering a side impact or landing too hard), your ship will lift off and perform a ‘Thrust of Shame’ back to orbit, while depressing tones emanating from the speaker inform the whole world of your failure. Pretty straightforward, really.
See it in Action
Here’s a video of me executing a NASA-worthy landing as preparations are underway for the Interactive Show.
Make your own!
If for some reason you should find yourself with an overwhelming desire to make your own electromechanical lunar lander game, grab the code I used here: moon.zip
This was an idea that I had been playing around with for 2-3 years, and this was one of the rare occasions where the game actually turned out better (and more fun!) than I expected. It really held up surprisingly well for the show, and provided hours of entertainment for drunken revelers (with minimal explanation/hand-holding required on my part). I think it was a lot more intuitive for the people that had actually played the arcade game before (so it was more popular with the over-30 crowd at the party), and several people were actually able to win after a few tries. Eventually the game got repatriated to my shop and dismantled for parts (many of which were recycled into my WaterBear Thunderdome for 2017’s Interactive Show!).