A couple of years ago, we featured the Pixy, a compact image sensor that can tag hundreds of objects based on their color. Electronics company RobotGeek combined Pixy with a couple of its robot kits to create a small turret that automatically follows and shoots at its targets.
The turret is a combination of the Pixy and the RobotGeek Desktop Robo Turret with the Foam Dart Gun (i.e. Nerf pistol) attachment. You’ll need to connect the Pixy to the turret’s Geekduino microcontroller via RobotGeek’s Sensor Shield. You can teach it to track certain colors using RobotGeek’s Arduino sketch. It will automatically follow objects that bear the target colors and shoot them if they stay still for a few seconds.
Head to RobotGeek’s Instructables page for the full guide. It’s an expensive toy, but at least you can expand its capabilities and use its parts for other projects.