资源描述:
《the engine behind splitter flash game – new as3 prototypes》由会员上传分享,免费在线阅读,更多相关内容在学术论文-天天文库。
1、TheenginebehindSplitterFlashgame–newAS3prototypes ath.*;import Box2d.mon.*; import flash.events.*; addEventListener(Event.ENTER_FRAME, update, false, 0, true);stage.addEventListener(MouseEvent.MOUSE_DODoUp);//stage.addEventListener(KeyboardEvent.KEY_DO_timeStep:Number = 1
2、/30;var m_physScale:Number = 50; var __sprite.addChild(dbgSprite);dbgDra_sprite = this;dbgDra_dra_fillAlpha = 0.3;dbgDra_lineThickness = 1.0;dbgDra_dra__physScale, 360/m_physScale/2);_physScale, 400/m_physScale/2);_Shapes();// Right_physScale, 360/m_physScale/2);_Shapes();
3、// Top_physScale/2, -1234567下一页[感谢阅读这篇文章,..,]95/m_physScale);_physScale/2, 100/m_physScale);_Shapes();// Bottom_physScale/2, (360+95)/m_physScale);_Shapes(); var body:b2Body; // Spa() * 5 + 10) / m_physScale, (Math.random() * 5 + 10) / m_physScale); bodyDef.position.Set((M
4、ath.random() * 400 + 120) / m_physScale, (Math.random() * 150 + 50) / m_physScale); bodyDef.angle = Math.random() * Math.PI; body = m_Shapes(); }/*for (i = 0; i < 5; i++){ var bodyDefC:b2BodyDef = ne() * 5 + 10) / m_physScale; // Override the default friction. circDef.f
5、riction = 0.3; circDef.restitution = 0.1; bodyDefC.position.Set((Math.random() * 400 + 120) / m_physScale, (Math.random() * 150 + 50) / m_physScale); bodyDefC.angle = Math.random() * Math.PI; body = m_Shapes(); }*/for (i = 0; i < 15; i++){ var bodyDefP:b2BodyDef = ne()
6、> 0.66){ polyDef.vertexCount = 4; polyDef.vertices[0].Set((-10 -Math.random()*10) / m_physScale, ( 10 +Math.random()*10) / m_physScale); polyDef.vertices[1].Set(( -5 -Math.random()*10) / m_physScale, (-10 -Math.random()*10) / m_physScale); polyDef.vertices[2].Set((
7、 5 +Math.random()*10) / m_physScale, (-10 -Math.random()*10) / m_physScale); polyDef.vertices[3].Set(( 10 +Math.random()*10) / m_physScale, ( 10 +Math.random()*10) / m_physScale); } else if (Math.random() > 0.5){ polyDef.vertexCount = 5; polyDef.vertices[0].Set(0, (1
8、0 +Math.random()*10) / m_physScale); polyDef.vertices[2].Set((-5 -Math.random()*10) / m_