Insight VR

Working Missile Command Posted!

by john on Mar.17, 2008, under Lasers, PyCon, missile command, pySight

I spent the plane ride home ripping all traces of py2app out of my code. This has resulted in a version of the missile command game that can be installed with more ease on other computers. At least I think so. Please let me know what your experience is.

The code is here and includes a READ ME file, the text of which I’ve pasted below:

READ ME

IMPORTANT:
Educate yourself about laser safety before using laser pointers with this game or for any project.

http://www.osha.gov/SLTC/laserhazards/

http://en.wikipedia.org/wiki/Laser_safety

More info and help available at:

http://insightvr.com

http://blog.insightvr.com

Laser Controlled Missile Command-like Game

This game demonstrates using PyGame and PySight to create a laser controlled video game.

The missileCommand.py file contains the bulk of the game and provides a cross-platform, mouse controlled PyGame implementation of something resembling Missile Command. It requires that you have Python and PyGame installed.

Run it at the command line with:

python missileCommand.py

The laser control code is currently Mac OS X only. It requires an iSight camera. This can be a built-in iSight in a laptop or iMac. It could also be an external iSight or any external fire-wire camera. I have only tested with my built-in iSight and with a Sony DV camera.

I believe that running with laser control requires the following to be obtained and properly installed:

Red laser pointer(s)
a projector or other external screen that is not connected to your iSight
PySight from http://livingcode.blogspot.com/2005/10/pysight-preview.html
CocoaSequenceGrabber from http://www.skyfell.org/cocoasequencegrabber.html
NumPy
PyObjC
PyGame

Setup of the projector and camera isn’t too hard, but I’ll share some hints. First, it needs to be dark. The darker the better. Second, the camera needs to have the entire screen in its field of view. Note that it doesn’t need to fill its field of view. You can check this quickly and easily by running PhotoBooth. Finally you can do rear-projection or front projection, but I believe that the camera needs to be on the same side of the screen as the projector. However the players do not. Thus on Halloween I have my computer and projector safely in the garage, a sheet which serves as a screen in the door of the garage, and kids playing with lasers in the driveway.

Run the laser controlled version of the game with the following command line statement:

python main.py

3 comments for this entry:
  1. Michael

    I just wanted to say for the record that of all the presentations at PyCon, your talk definitely had the best “wow factor”. Even while you were handing out laser pointers to people who asked questions, I don’t think many saw what was coming. When you fired up the second demo with the wiimote head tracking… friends in the next room could only wonder what the heck got everyone so excited.

    Oh, and as one of the few to get a chance to actually try Missile Command at the BOF, I can definitely vouch that it’ll be worth the effort to anyone with a projector to set this up. B^)

  2. Peter

    I’m giving this a go on the weekend, might try and make a version that sprays fairy dust and catches butterflies or something similar and make the laser pointers into wands. That is what happens when you have a plethora of girls under 10…

  3. john

    Peter,

    That shouldn’t be too hard to do. The game is already more of a interactive art piece than a real game. I’ve seen both kids and adults sit there in a bit of a trance drawing patterns of explosions without regard to the status of the game itself. Of course the game is so easy that they do well at it regardless.

Leave a Reply

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!