资源描述:
《full totem destroyer prototype》由会员上传分享,免费在线阅读,更多相关内容在学术论文-天天文库。
1、FullTotemDestroyerprototype SometimeagoIpostedCreateaFlashgamelikeTotemDestroyer,andnoshoadebyCollinDouch. SuchdetectionadecustomizingBox2Dsb2ContactListenerclass.FormoreinformationaboutthisclassrefertoUnderstandinghoanagescollisions. Thisisthemainfile:package{ i
2、mport flash.events.* import flash.events.MouseEvent import flash.display.Sprite import flash.text.* import Box2D.Dynamics.* import Box2D.Collision.* import Box2D.Collision.Shapes.* import Box2D.mon.Math.* public class totem extends Sprite{ var boxDef:b2PolygonDef
3、 var bodyDef:b2BodyDef var circleDef:b2CircleDef var body:b2Body var nx:Number var ny:Number var nn:String var mousePVec:b2Vec2 = neber = 0 var bombCount = 3 var foundTotem:Boolean = false var totemFound:b2Body = null var n_ber var n_height:Number var n
4、_static:Boolean var n_name:String var n_destroyable:Boolean var n_restitution:Number var n_friction:Number public function totem(){ addEventListener(Event.ENTER_FRAME,Update) stage.addEventListener(MouseEvent.MOUSE_DO(); CreateLevel(nee("Box"),true,1,0.00
5、1,"Slimy"],[200,320,20,20,false,GetName("Box"),true,0.3,0.3,"Block"],[300,340,20,20,false,GetName("Box"),true,1,0.001,"Slimy"],[300,320,20,20,false,GetName("Box"),true,0.3,0.3,"Block"],[250,300,120,20,false,"BG",false,0.3,0.3,"unBreakable"],[200,280,20,20,false,GetN
6、ame("Box"),true,0.3,0.3,"Block"],[200,260,20,20,false,GetName("Box"),true,0.3,0.3,"Block"],[200,240,20,20,false,GetName("Box"),true,0.3,0.3,"Block"],[300,280,20,20,false,GetName("Box"),true,0.3,0.3,"Block"],[300,260,20,20,false,GetName("Box"),true,0.3,0.3,"Block"],[
7、300,240,20,20,false,GetName("Box"),true,0.3,0.3,"Block"],[250,220,120,20,false,"BB",false,0.3,0.3,"unBreakable"],[250,205,21.4,33.6,false,"Totem",false,0.3,012345下一页[感谢阅读这篇文章,..,].3,"Totem"])) } public function GetName(possName:String){ var nameing = "Box"+boxCo
8、unt return "Box"+boxCount; boxCount++ } public function CreateLevel(LevelArray:Array){ for(var a:int=0;a<LevelArray.length;a++)