One thing you might notice about me (especially in Lego weapons) is that whenever I learn that someone tried to do something but failed I try to do it. It's not that I mean to prove that I'm better than them, it's just that I get struck with inspiration and I want to make something that I know will be cool. In this case, my plan is to build a Lego tank with a turret that rotates and fires using a pull back and release mechanism like MoshiB9865's "Airsoft" gun.
I managed to construct a simple proof of concept for the tank, including a working version of the gun. The tank's drivetrain has roughly 0 ground clearance and the gun has much less power than I want from the final version, but it still illustrates that the design is sound.
Proof of Concept Tank
The drivetrain is very simple (the final version will likely be more complex). It is basically just a pair of straight treads with a raised platform in the middle. Behind the platform are the drive motors that link to the treads directly, underneath and flush with the platform are the NXT brick and the rotation motor, which is directly attached to an axle in the middle. On that axle is mounted the gun, which is able to swivel around on the smooth surface of the platform.
The gun itself consists mainly of a firing rod covered in rack gears and a driven gear that is able to pivot up and down. Here's how it works:
1: The driven gear pulls back the firing rod (attached to the rack gears).
2: When the driven gear reaches the front of the area of the firing rod that is geared, it climbs up another piece (in this case a 2 unit pin), disengaging from the rack gears.
3: The firing rod is now free to fly forwards and fire a shot.
4: When the firing rod stops, the driven gear falls back down onto the rack gears and pulls it back again. Here's a video of the various mechanisms involved:
UPDATE: Here's a sneak peek of the final version: