Problem: A game made in the Box2D physics engine was displaying odd behavior. The player would hover above the ground at the start of the game, and occasionally blocks would fly off the screen for no apparent reason.
Impact: Since the game was still in the early stages of development, this error did not majorly affect game play, but it was clearly something wrong that needed fixing before the final version.
Solution: Through experimentation, we discovered the problem was some invisible boxes we had created at some point in the code. The player would start standing on it, causing the hovering. Actual drawn blocks would fly off at random if the layer accidently kicked the invisible block into them. By searching through the source code and deleting every unused body and fixture definition, the problem went away.
No comments:
Post a Comment