《managing multiple gravities with box2d》由会员上传分享,免费在线阅读,更多相关内容在学术论文-天天文库。
1、ManagingmultiplegravitieswithBox2D OneoftheapparentlyhardestthingstodoayaypleIamtalkingabout. Thereisoneulatedifferentgravityandoneainscript,directlyfromtheHelloath.*; public class HelloE, Update, false, 0, true); var __sprite=dbgSprite; dbgDra_dra_fillAlpha=0.5; dbgDra_lineThickness=1.0
2、; dbgDra_dra__Shapes(); bodyDef = ne_Shapes(); for (var i:int = 1; i < 10; i++) { bodyDef = ne()*12+2; bodyDef.position.y=Math.random()+5; var rX:Number=Math.random()+0.2; var rY:Number=Math.random()+0.2; if (Math.random()<0.5) { boxDef = new b2PolygonDef(); bo
3、xDef.SetAsBox(r12345下一页[感谢阅读这篇文章,..,]X, rY); boxDef.density=1.0; boxDef.friction=0.5; boxDef.restitution=0.2; bodyDef.userData = nee="box"; body=m_e="circle"; body=m_Shapes(); addChild(bodyDef.userData); } } public function Update(e:Event):void { m__timeStep, m_i