Arduino Asteroids

[nootropic] has a new game out for hackvision, “Asteroids”! We covered the hackvision back when it first started appearing in October of 2010, and hardware wise it has not changed. It is still an Arduino (software) compatible system sporting a atmega328, video and audio out connections (uses the TV-out library), all on a nice printed circuit board that, with the buttons, resembles a game controller.

While its impressive enough to run arcade inspired games like space invaders, pong, and tetris while using Arduino and a library, Asteroids takes the game up a notch.

Features that make Asteroids well, Asteroids include a mod of the TV-out library so that bitmaps can fly over each other without erasing the pixels under them to give that old time vector arcade feel, and “point in polygon” style collision detection, which is a fantastic / efficient way of collision detection against irregular shapes, limited platform or not.

Last but not least, [nootropic] used the set_vbi_hook() function of the tv out library in sound design, going from simple “beeps” and “boops”, to “beeps” and “boops” on a constant 60Hz refresh (in the case of NTSC) that allows him to build more complex sound effects that give a nice arcade sound of explosions and laser blasts.

Join us after the break for a quick video, and remember, this is Arduino based so if you already have an Arduino, you can add the supporting hardware (buttons, resistors, and RCA jacks) and run any of the games currently offered, or make your own.

[youtube=http://www.youtube.com/watch?v=w03dO0Hd660&w=470]

17 thoughts on “Arduino Asteroids

  1. The TI LaunchPad has far to little memory. The ATmega328 has 2K of SRAM (frame buffer requires over 1.5K) and 32K of flash to store the program (Asteroids is over 28K). It looks like the TI mcu on the LaunchPad only has 2K of flash and 128 bytes of RAM.

  2. Cool stuff. I need to work on my gamedev, and I’m really interested in the restrictions impossed by these little chips. OpenGL is too easy.

    For those of you who needs an asteroids fix. paste this code in your address bar and hit enter.

    http://pastebin.com/ZAHNuU7n

    Of course, you don’t have to trust me (it is technically possible to steal cookies this way) but of course the link to the js file is right there, so you can read the code if you’re wary. It’s worth it though.

  3. @nickstewartroc and nootropic,

    I’m fairly confident that Asteroids could be ported over to the Launchpad despite the SRAM and Flash limitations. The graphics pipeline would have to be reworked (no framebuffer, probably a line-buffer based approach) and you would probably have just use the vertexes or other primitives for the polygons instead of bitmaps, but it’s definitely possible. If I get some time I’ll mess around with writing it up for the Launchpad.

  4. This is a pretty cool use of the Arduino platform. However, lets not forget the Uzebox/Fuzebox. It’s based on the 644P (which means 64k of space instead of 32k) and has a few other neat features tucked in as well.

    Check it out here: http://www.belogic.com/uzebox/

    There are plenty of full games, with source, available for anyone to get started. And there is a very tight-knit user community around the project.

  5. It’s lovely to see people hacking around the limitations of a platform to add a better gaming experience to it… but it’s still got a ways to go to catch up to the Atari 800 port (which sported color, and up to 4 players on much slower hardware…)

    Also what’s with the velocity? It seems like there is either too much friction, or he was too afraid to show us that it wasn’t working right (he didn’t move much during the replay.) Nothing worse than a bad asteroids clone without REAL 2D velocity tracking…

  6. I’m an avr guy at heart. As such, I think these projects are great how they push the video capabilities of the platform.

    That said, the Propeller is certainly the architecture to use for uc based video projects.

  7. I hate to be the one to do this, but I just spent way too long trying to figure out the sentence, “Features that make Asteroids well, Asteroids include…”

    A comma before ‘well’ and another comma after the second ‘Asteroids’ would make it more clear what you’re going for there.

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.