I started to port over some games and prototypes that I have worked on in Flash over to Corona. In doing this I noticed a couple of missing features. These are a couple of things I noticed in the AS3 port of Box2D that are missing in this implementation that I would really love to have. In many cases, I can not complete these demos (or it would take serious reworking) in Corona without these features.
1. The ability to cancel individual collisions. In the Flash port, I was able to cancel these collisions by doing something like so:
[as3]package {
import Box2D.Collision.b2Manifold;
import Box2D.Dynamics.b2EmptyContactListener;
import Box2D.Dynamics.Contacts.b2Contact;
public class PCollider extends b2EmptyContactListener {
override public function PreSolve($contact:b2Contact, $oldManifold:b2Manifold):void {
// check if object is not on top of platform
var isNotOnTop = …
if (isNotOnTop){
$contact.SetEnabled(false);
}
}
}
}[/as3]
I need this to create the one-sided platforms that work with more than one colliding entity (multiple enemies in a platformer or multiple pinballs going through gates).
2. The ability to refilter bodies after creation. Sure I could create a new instance and copy the position, rotation, velocity and all the custom data. But then I’d have to update all my references too and kill and re-add listeners. Not ideal.
https://developer.anscamobile.com/forum/2011/06/14/set-box2d-collision-filtergroupindex-after-physics-body-added
3. The creation of multiple shapes with different behavior in one body. Now this one might be tricky the way you guys implemented shapes. But in Box2D, including the AS3 port, I could create multiple shapes with different settings (restitution, friction, density, is sensor…) in one body. That comes in handy when creating more complex physics objects. It seems like I need a new display object for every shape I create.
Any thoughts on these? I’m also not a subscriber (yet?) so these may have been dealt with already. [import]uid: 78875 topic_id: 14023 reply_id: 314023[/import]