Collision detection itself isn't really that hard. The problem is trying to get the culling right so the collision detection doesn't get too slow.
The most basic collision detection is circle-on-circle, which can be found by seeing of the center of the smaller circle is a shorter distance away than the radius of the larger circle. There might be better way to do this, but this is the most basic way I could think of.
Rectangles are not too bad either, assuming they are oriented the same way as the axes of the coordinate system. If not, you need to do oriented bounding box collision detection using the parallel axis theorem or something. Just a bit a linear algebra there.
Not too sure about triangles though.
As for culling, most implementations of 2D collision detection tend to use quartic trees, I believe. Chipmunk uses a hash instead, but I hear the algorithm is much more complicated. The reward for the underlying hash is the speed of course.
However, Chipmunk uses Euler integration, so it should be interesting to see how the two stack up, if you ever get to implementing collision detection as well. Still, even with good culling, most of this stuff gets pretty slow fairly quickly. Thus, if you know C, it would be cool to see this re-implemented in C.
Hope that's enough to point you in the right direction.