As tunneling through static bodies isn't allowed thanks to continuous collision detection, in some cases we can also enable it on dynamic bodies by setting them as bullets. A bullet performs continuous collision detection with static and dynamic bodies.
Remember, you can experience heavy performance issues if you set all bodies to bullets, so it's up to you to find a compromise between accuracy and performance.
In my experience, I had to set as bullets only some particles and projectiles fired by players or enemies. Normally game characters do not move that fast to require them to be set as bullets.
Change the
Main
function by adding the highlighted line:public function Main() { world=new b2World(new b2Vec2(0,5),true); debugDraw(); var bodyDef:b2BodyDef=new b2BodyDef(); bodyDef.position.Set(320/worldScale,470/worldScale); var polygonShape:b2PolygonShape=new b2PolygonShape(); polygonShape.SetAsBox(320/worldScale,10/worldScale); var...