dottified
dottified

Reputation: 45

Can't replace one body/shape with two body/shapes in pymunk

I am working on a program with pymunk and pygame where I am trying to simulate objects growing and dividing. I have implemented this by stepping through the program and removing each body/shape at certain intervals and adding a new, slightly larger body/shape. I wrote separate functions for initializing the objects, growing the objects, and dividing the objects. I am trying to divide the objects by replacing each body/shape with two bodies/shapes.

This appears to work okay with the "growing" phase, but when I get to the dividing function, all of the bodies disappear from the screen! I can tell from print statements that there are twice as many shapes in the space as before and that they then double again after another interval, but they completely stop showing up. My functions for growing the objects and dividing the objects are very similar, so I'm not sure what the issue is.

Any help you could provide would be much appreciated. My program is very long, so I haven't included my code, but I can try and include some if you feel that would be helpful.

Upvotes: 0

Views: 156

Answers (0)

Related Questions