Mini Pinball Machine | The MagPi #117

Gamers are sure to have a ball with Chris Dalke’s fun desktop pinball table. In the latest issue of The MagPi, out now, David Crookes has his fingers at the ready…

Pinball machines have been around for decades. They were popular during the Depression in the 1930s, banned under US gambling laws for 34 years from 1942, developed flippers in 1947 and saw a resurgence in popularity in the 1990s. But, in all that time, the machines have had one thing in common: their sheer size and weight.

That, however, didn’t stop Chris Dalke from trying to create a version of his own. “Years ago, I had a high school woodshop class with access to a CNC wood cutter,” he says. “I tried to make an electromechanical pinball machine but never finished because the project was too ambitious in scope for my skill set and budget at the time.”

Even so, the desire to create a pinball machine remained strong so he tried again, this time creating a miniature version using a Raspberry Pi 4 computer, an Arduino Uno, an LED matrix display, a bunch of buttons and a 7-inch HDMI touchscreen. “It constrained the project to a more realistic scope,” he says. “It also allowed the enclosure to be smaller so it could be brought out and played on a tabletop.”

The laser-cut maple exterior gives a solid arcade feel
The laser-cut maple exterior gives a solid arcade feel

Lane change

Chris had a clear objective in mind from the start. “I wanted to retain the feeling of a physical arcade game with intense sound, vibration and colours as well as the tactile response of the inputs,” he says. “I noticed many arcade games feel very good at the lowest level of tactile response, an individual button or joystick press, so I started there, with clicky arcade buttons.”

Raspberry Pi 4B and an Arduino Uno are at the heart of the build. Chris says the project was iterative, however, so he doesn’t have build plans

To that end, he decided not to replicate the mechanics of a pinball machine. “It was less about the pinball machine and more about building the complete experience of a small arcade game that could retain the feel of a full-scale game,” he explains. It led him to create a screen-based version of pinball which he coded in C++ and OpenGL, using the open-source software development library Raylib to create both the graphics and audio.

Rather than run an existing pinball game, Chris created his own. It runs at 60fps and contains power-ups and high scores

“I chose very vibrant neon-inspired colours: purple, green and pink which are very saturated on the monitor,” he continues. “In the game code I also added extensive juicing which is the use of many small animations and visual/audio tweaks to improve the feel of a game. For example, the ball and bumpers stretch and distort excessively when a collision occurs, exaggerating the physical effect of the collision.”

Keeping score

For an authentic look, Chris naturally wanted the laser-cut Baltic birch plywood enclosure to resemble a pinball machine, so he tweaked the design to ensure it was unmistakable. “Initially, I’d designed a flat box without the vertical headboard seen in conventional pinball machines but I added an LED matrix and vertical section,” he says. “I wanted to retain the visual signature of a pinball machine and have some element that made the game feel less like it was played only on the touchscreen.” YouTube videos such as Secrets of Game Feel and Juice helped Chris when designing the game.

After creating a CAD render of the Pinball Machine around the size of a Raspberry Pi 4 and a HDMI screen, Chris laser-cut each of the enclosure pieces out of Baltic birch plywood

The Adafruit LED matrix provides the score and feedback and it certainly looks the part. “The LED matrix casts a very nice orange light onto the wood and it works well to pull the gameplay out of the screen and into the physical world,” Chris continues. The Arduino Uno drives the LED matrix and button inputs, and it communicates with the Raspberry Pi board via a serial protocol. The Raspberry Pi is connected to a speaker driver too, allowing for stereo sound.

It may look like there’s ample room but getting all of the electronics inside the enclosure was tricky. Slats are cut into the side of the enclosure to allow players to hear the stereo sound.

“I also included a solenoid which I planned to trigger for haptic feedback,” he says. “But the vibration was too high-frequency to match the expectation of a heavier ball – I ended up using sound effects instead.” Still, this doesn’t detract from the overall build, and Chris is very pleased with how it’s turned out. “The project is the sum of many individual tweaks to the components, but the whole experience comes together very well.”

Get The MagPi #117 NOW!

You can grab the brand-new issue right now from Tesco, Sainsbury’s, Asda, WHSmith, and other newsagents, including the Raspberry Pi Store in Cambridge. You can also get it via our app on Android or iOS. And there’s a free PDF you can download too.

magpi 117

You can also subscribe to the print version of The MagPi. Not only do we deliver it globally, but people who sign up to the twelve-month print subscription get a FREE Raspberry Pi Zero 2 W!

No comments

Comments are closed