I have a problem with physics that I haven’t been able to solve. I’d post code, but I wouldn’t know where to start, as it’s spread across multiple modules.
A little background. In my game, which is under development, you flick ice cubes into glasses. Each level provides tougher challenges, but basically there are glasses placed in various positions and you have a certain number of cubes and have to get one in each glass without knocking any over.
At level init time, my level loader draws the new rocks (static physics objects) with the glasses (dynamic physics objects) on top of some. The glasses are initialized a few pixels above the rocks they are to rest on, and they settle into place nicely. So for the most part, it works.
Except when it doesn’t. In the current level config, every time the fifth level starts, the glass doesn’t sit down right and tumbles over, breaking on the ground below.
I’m not doing anything different based on which level is being played, and in fact, if I start on level five, I can’t recreate the problem. If I make that level the first and the fifth, it works fine on level 1 but fails on 5. I’m guessing there is some kind of cumulative effect building up that rears its ugly head by the time I get to the fifth level.
Anyone have an idea where I can start debugging? Or maybe a suggestion on how to better initialize my levels?
Thanks for reading this. Oh, and here is a screenshot to give an idea of what the game looks like.
http://mikesellsoftware.com/OnTheRocks.png [import]uid: 58455 topic_id: 15367 reply_id: 315367[/import]
[import]uid: 9422 topic_id: 15367 reply_id: 56795[/import]