There was a guy on YouTube several years ago who designed something similar. It was all open source. The videos were absolutely hilarious because he used himself as a target. It was highly accurate. Search for motion activated paintball gun or something like that.
http://www.TurretSentry.com/
Here you go