Saturday, April 9, 2011

10


Problem: Objects in Box2D were registering collisions, even when they were not even close to touching. Specifically, particles of water were supposed to delete themselves on contact to anything, but thought that they were colliding with the nearby player as soon as they were created and instantly deleted themselves.

Impact: The player could not shoot, keeping them from playing the game.

Solution: We had created a custom collision listener to see when the water should be deleted, but forgot one important line of code: if(contact.isColliding){. Without calling this to see if the objects were actually, physically touching the collision listener would be called even if the objects were only near each other. Adding that line fixed the problem.  

No comments:

Post a Comment