Arduino Video Game for the Neighbourhood
// November 18th, 2013 // arduino
My house/office has a store window and I try to make use of it as much as possible. I had some projections etc. in there before, but now I wanted to make something interactive. We have a lot of loitering youth and many people passing by. To appeal to a wide audience, I thought it would be nice to make an old fashion arcade box like thing.
It’s now on the street for one day and people really seem to like it. Age or background doesn’t make a difference.
To make it a little bit more challenging, I thought it would be fun to try to run the hole thing on an Arduino without an external computer. Just to see how much power it actually has. And while I was at it, I decided to try to make everything myself. So I also made my own led screen, with his own “display driver” and display list, a 8-bit sound library, and of course the game itself.
The only thing I didn’t make was the background music for the game, that was composed by the lovely Annegreet Sledsens: Thanks sweety! You can hear it in the video.
The led screen is very bright which made it very hard to film and photograph with my cheap camera. Even after some photoshopping, I couldn’t make it look as good as in real life. So if you’re in the neighbourhood (Antwerp Belgium, Provinciestraat 60, behind the Zoo), feel free to come check it out and play a game with the locals!
Here the video and some more pics:
I needed something that would appeal to a large audience (the people in my street) and something was fun to play .
So I took the good old gaming cliché, where the world gets invaded by aliens and you have to fight your way to the end boss, save the world and the human race . With my minimal resolution of 16*90 pixels, I didn’t have much other choice than making it pixel-art style.
The game has 3 modes, a single-player and a multiplayer brawling/fighting the aliens mode, and an extra fighting mode where the 2 players can battle with each other.
Every mode has just one level, but since it is just a casual “play on your way to work” kind of game, I thought it would be more then ok.
The game-mode selection:
Two players fighting the the final boss:
The girl kicking the boys ass in fighting mode:
To make the development easy and fast, I cross developed the game as a Cinder c++ app and an Arduino app, that way i didn’t had to upload the whole thing on an Arduino every time I wanted to test something.
I didn’t use any external memory, so I had to store everything on the Arduino. I made a small app that generates c++ classes from bitmaps with some gamma correction for the led screen. I used indexed colours to save some of that precious SRAM. For driving the leds, I modified the Adafruit neopixel lib, to support alpha-blending and make it a little bit faster for my specific case.
I don’t really have much experience with generating sound and music. So the 8-bit sound was quite challenging. I’m happy with the result, but my oscilloscope broke during development of a more advanced sound lib, so its quite simple for now. But I really enjoyed myself working on the sound aspect. I have a feeling that my next project is going to be something sound/music related
I’m not going to elaborate too much on the rest of the code. But you’re free to check the source code yourself (warning: its messy).
The full source code and game assets on Github (Code-> MIT, Assets-> CC attribution)
Like I said, I made my own led display.
I used strips of WS2812 LEDs, those are individually-addressable RGB LEDs. The lay in a 16*90 grid (=1440 leds)
I added a laser cut raster over the leds to make the pixels square and put a layer of plexi to diffuse the light some more.
Beneath the leds is the main Arduino Due and the power source. This is the Arduino that drives the display and runs the game. Those leds suck a lot of power , so I had to add a 60A 5V power supply.
The screen/main arduino is connected with the arcade box through a simple tx-rx serial line, which was fast enough to send the button commands.
the arcade box is just some painted MDF with a steel frame inside, and a steel plate on-top (it has to be a little bit solid if i leave it outside )
The Arduino in the arcade box generates the sound and music and handles the raw button/joystick input.
If your interested, the full “schematic” of the project:
Its pretty straight forward.: Pulldowns for the buttons and joystick, the led connections and a pot for the screen brightness and a tx-rx line between the two Arduinos.
on top of that there is a DC coupling for the speaker which is connected to the Arduino DAC . But I still have to put some kind of amplifier between the arduino and the speakers. The sound is hard to hear because of the street noise.