It uses two physical mechanisms to shoot the projectile: a lever and a sling. As the force of gravity acts on the counter weight, the counter weight end of the lever would go down and the other end of the lever would be lifted. Also, depending on the location of the pivot of the lever, the velocity would be amplified. When the projectile end of the beam reaches certain height, it starts to lift the projectile by the force of tension acting on the sling. Then the projectile would follow a circular path by the sling at the same time as it follows the circular motion by the lever.
The sling releases when it reaches certain angle and the projectile would be fired (the angle can be controlled).
The velocity and the expected distance of the projectile can be estimated by the calculation using the potential energy and the kinetic energy of the counter weight. However, the precise calculation is very complicate.
For further information on calculation you can access:
Interesting question to ask:
Is the scene in the movie realistic? (at 18s of the video: http://www.youtube.com/watch?v=7bFTw95pJp8)