Thanks for the kinds words. I'll try to explain it in details here:
The OnCollision member of the Geom class is what is called a delegate. A delegate can be seen as a list of methods that needs to be called whenever the delegate is invoked. To use the OnCollision delegate, you simply subscribe (add your method to the list)
to it by doing the following:
myPlayerGeom.OnCollision += MyCollisionMethod;
Inside the engine it runs some modules to make it all work. One of the modules (called narrow phase in this case) invokes the delegate and thus calls
all the methods that are subscribed to the delegate. In the example code provided above, the delegate calls MyCollisionMethod.
But that method needs to have a specific signature (specific return value and arguments) and it looks like this:
public bool MyCollisionMethod(Geom geomA, Geom geomB, ContactList contactList)
So each time "myPlayerGeom" collides with something else, your method called MyCollisionMethod gets called. The geomA argument contains a reference to myPlayerGeom and the geomB argument contains the other geometry (the ground, another player or
something else). The contactList argument contains the contacts between the two geometries. In simple games you don't even have to use the contactList argument.
As you see, I return true inside the method. This is needed to tell the engine if you want a collision response or not. If you return true, the two geometries will collide and get separated. Return false will make the two geometries pass each other (collision
does not get registered).
Tell me if you still need an example and I will edit Demo2 to show how it works. It is really more simple than it sounds.