I think the trick is not to rely on the comings and goings of the add/remove within a single step. I use them only to alter the counters. Then I actually do what I want to the character during the prestep (most stuff like move them left/right, etc) method or a key handler (one time things, like jumping). That way I don't care how many times the contact gets added or removed for the same set of shapes during that step as long as it averages out to the same. For example, one contact gets removed, but another is added still works out to a count of 1 when I check the status at the next step.
FYI - I see you are using circles instead of polygons. At least in the java version I've noticed my counts get wacky when I mix those in. I haven't tracked it down to my problem or the API yet though (boxes all seem to work fine, maybe it's the way I calculate the normals).
I like the graphics in your screenshots! I wish I had just a small amount of artistic talent 🙂
FYI - I see you are using circles instead of polygons. At least in the java version I've noticed my counts get wacky when I mix those in. I haven't tracked it down to my problem or the API yet though (boxes all seem to work fine, maybe it's the way I calculate the normals).
I like the graphics in your screenshots! I wish I had just a small amount of artistic talent 🙂