Hi mayobutter, thanks for your reply.
Do you mean that by setting "reportBeginContact" and "reportBeginContact" to false, no contact will be stored?
I use the BEGIN_CONTACT listener to know when an object ist catched by the box and then increase the player's score. What I also do is to adjust this falling object's categoryBits and maskBits so as the sensor doesn't catch them twice.
I also use a BEGIN_CONTACT listener it in an object called scenary (floor and left/right walls) that detects when an object is fallen out from the box and destroys it.
Do you mean that I don't need then to control a ContactList? What I do into my step event listener is to clean this list.
But sometimes I have a serious problem that I thought was related with this contacts management but still have, and is that sometimes my game crashes with the following error:
Code:
Assertion failed: (m_contactCount < m_contactCapacity), function Add, file ../Box2D/Dynamics/b2Island.h, line 74.
[object AlchemyExit]
at Function/<anonymous>()
at Function/<anonymous>()
at Box2DAS.Dynamics::b2World/HandleStep()[/Users/jordi.tost/Projekte/LC Smartboard/flash/wcklib/Box2DAS/Dynamics/b2World.as:162]
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at Box2DAS.Common::b2EventDispatcher/dispatchEvent()[/Users/jordi.tost/Projekte/LC Smartboard/flash/wcklib/Box2DAS/Common/b2EventDispatcher.as:27]
at Box2DAS.Dynamics::b2World/Step()[/Users/jordi.tost/Projekte/LC Smartboard/flash/wcklib/Box2DAS/Dynamics/b2World.as:158]
at wck::World/step()[/Users/jordi.tost/Projekte/LC Smartboard/flash/wcklib/wck/World.as:198]
Assertion failed: (IsLocked() == false), function DestroyJoint, file ../Box2D/Dynamics/b2World.cpp, line 270.
[object AlchemyExit]
at Function/<anonymous>()
at Function/<anonymous>()
at Box2DAS.Dynamics.Joints::b2Joint/destroy()[/Users/jordi.tost/Projekte/LC Smartboard/flash/wcklib/Box2DAS/Dynamics/Joints/b2Joint.as:32]
at Function/<anonymous>()[/Users/jordi.tost/Projekte/LC Smartboard/flash/wcklib/wck/Joint.as:614]
at Function/http://adobe.com/AS3/2006/builtin::apply()
at wck::World/step()[/Users/jordi.tost/Projekte/LC Smartboard/flash/wcklib/wck/World.as:200]
This seems to be a box2d error, and I think that means that the contacts buffer is already full. Because of this I tried to destroy the contact with that 2 lines of code, but seems that it's not the solution and I couldn't fix the bug:
Code:
b2Contact(e.contact).SetEnabled(false);
b2Contact(e.contact).destroy();
The structure of the game is simple. Just has a box, an scenery and dinamically created objects (each second, during a minute) that fall "from the sky". The user must catch the objects with the box, and the scenery removes them when they are not catched.