I think the issue was by ths following , There is no built in way to do it directly in pymunk. The easiest is probably to calculate it yourself. Loop the bodies and for each body make a space query to find nearby bodies. Calculate the resulting gravity and use apply impulse. (Possibly its possible to emualte with one of the constraints, for example the pin joint or damped spring.. but that will require some thinking and experimenting to find out if its possible and looks good)
To fix the issue you can do The problem with the code in the gist is that you have attached the gun to the hand with two joints to keep them in the same place and same rotation. However, the the hand is a rouge body and wont rotate. Therefor the gun wont rotate when its pulled by the spring between it and the cursor, because that other joint is stronger. Im not sure exactly how you want the setup, but you can see that it all works if you remove the RotaryLimitJoint from the gun-hand.
How to keep one body on top of another using Pymunk
I think the issue was by ths following , Pymunk itself doesn't depend on any visualization. You move the simulation forward with the space.step method, and you can call it as many times as you want, for example 1000 times with a dt of 0.1 to move the simulation forward 100 units (seconds). If you want to see something you have the option to read out the state and draw it at that time.
Pymunk Body moving without moving pymunk shape vertices
With these it helps One thing which can cause the behavior is to not put center of gravity (CoG ) in the actual center (or close to it). In your code the way both the ground and the tank poly shapes are built means that their CoG will be at the first corner of the shape, at (0,0). Try instead to build the poly vertices as: