<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>parpue.net &#187; 衝突</title>
	<atom:link href="http://parpue.net/tag/collision/feed" rel="self" type="application/rss+xml" />
	<link>http://parpue.net</link>
	<description>Flash, Flex, デザイン等自分の好きなことを好きなようにやってます</description>
	<lastBuildDate>Wed, 12 Aug 2009 17:46:04 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>ja</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Box2d で降りしきる箱と戯れる箱</title>
		<link>http://parpue.net/web/35</link>
		<comments>http://parpue.net/web/35#comments</comments>
		<pubDate>Mon, 07 Jul 2008 06:09:08 +0000</pubDate>
		<dc:creator>okm</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[WEB]]></category>
		<category><![CDATA[actionscript3]]></category>
		<category><![CDATA[Box2D]]></category>
		<category><![CDATA[衝突]]></category>

		<guid isPermaLink="false">http://parpue.net/?p=35</guid>
		<description><![CDATA[				前回に続きまして、四角の一人四角遊びです（？）
				
				
				
				画面をクリックした後、「←」「→」で左右移動、「s」キーでジャンプです。
				前回同様、「s」キー連打で多段ジャンプ！
				↓参考にさせていただきました。
				■Box2Dサンプル maskBitsによる衝突フィルタリング
				今回やりたかったのは、上からものを落として、
				何回かぶつかったら、部屋から立ち去らせるということ。
				具体的には、
				3回、床との衝突を検知したら、
				落ちてくる箱の衝突フィルタの値を変更するということをやりたかった。
				箱を定義するときにIDを指定しておくことで、何と何が衝突したか検知できる。
				&#62;&#62;text
				ACTIONSCRIPT:
				
				
				
				var floorBodyDef:b2BodyDef = new b2BodyDef&#40;&#41;;
				&#160; &#160; // 床のIDを floor としておく
				&#160; &#160; floorBodyDef.userData = new Object;
				&#160; &#160; floorBodyDef.userData.id = "floor";
				&#160; &#160; floorBodyDef.position.Set&#40;6, 8&#41;; 
				
				
				
				
				3回衝突を検知したら、maskBitsの値を0x00に変更して、誰とも衝突しないようにする。
				Box2Dのソースから追って、filterを再度ゲットできるところを探したんだけど、
				これでよかったんだろうか。
				&#62;&#62;text
				ACTIONSCRIPT:
				
				
				
				for &#40;var ce:b2ContactEdge = floor.m_contactList; ce != null; ce = ce.next&#41; &#123;&#160; 
				&#160; &#160; var obj1:b2Body = ce.contact.GetShape1&#40;&#41;.m_body;//1つ目のオブジェクト 
				&#160; &#160; var obj2:b2Body = ce.contact.GetShape2&#40;&#41;.m_body;//2つ目のオブジェクト
				&#160; &#160; if&#40;obj1.m_userData &#38;&#38; obj2.m_userData &#38;&#38; ce.contact.GetManifoldCount&#40;&#41; == 1&#41;&#123;&#160;  [...]]]></description>
			<content:encoded><![CDATA[				<p>前回に続きまして、四角の一人四角遊びです（？）</p>
				<div style="border:solid 1px;padding:0;margin:0;width:540px;height:360px">
				<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="540" height="360"><param name="id" value="labyrinssuite" /><param name="align" value="middle" /><param name="allowScriptAccess" value="sameDomain" /><param name="quality" value="high" /><param name="scale" value="noscale" /><param name="src" value="http://parpue.net/wp-content/labyrinssuite3.swf"/><embed id="labyrinssuite" type="application/x-shockwave-flash" width="540" height="360" src="http://parpue.net/wp-content/labyrinssuite3.swf"  scale="noscale" quality="high" allowscriptaccess="sameDomain" align="middle"></embed></object>
				</div>
				<p>画面をクリックした後、<b>「←」「→」</b>で左右移動、<b>「s」</b>キーでジャンプです。<br />
				前回同様、「s」キー連打で多段ジャンプ！</p>
				<p>↓参考にさせていただきました。<br />
				■<a href="http://www.matzmtok.com/blog/?p=53">Box2Dサンプル maskBitsによる衝突フィルタリング</a></p>
				<p>今回やりたかったのは、上からものを落として、<br />
				<b>何回かぶつかったら、部屋から立ち去らせる</b>ということ。</p>
				<p>具体的には、<br />
				3回、床との衝突を検知したら、<br />
				落ちてくる箱の衝突フィルタの値を変更するということをやりたかった。</p>
				<p>箱を定義するときにIDを指定しておくことで、何と何が衝突したか検知できる。</p>
				<div class="igBar"><span id="lactionscript-4"><a href="#" onclick="javascript:showPlainTxt('actionscript-4'); return false;">&gt;&gt;text</a></span></div>
				<div class="syntax_hilite"><span class="langName">ACTIONSCRIPT:</span>
				<div id="actionscript-4">
				<div class="actionscript">
				<ol start="64" style="margin:0px; padding:0px" >
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><span style="color: #000000; font-weight: bold;">var</span> floorBodyDef:b2BodyDef = <span style="color: #000000; font-weight: bold;">new</span> b2BodyDef<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; <span style="color: #808080; font-style: italic;">// 床のIDを floor としておく</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; floorBodyDef.<span style="color: #006600;">userData</span> = <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #0066CC;">Object</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; floorBodyDef.<span style="color: #006600;">userData</span>.<span style="color: #006600;">id</span> = <span style="color: #ff0000;">"floor"</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; floorBodyDef.<span style="color: #0066CC;">position</span>.<span style="color: #0066CC;">Set</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;color:#800000;">6</span>, <span style="color: #cc66cc;color:#800000;">8</span><span style="color: #66cc66;">&#41;</span>; </li>
				</ol>
				</div>
				</div>
				</div>
				<p>3回衝突を検知したら、maskBitsの値を0x00に変更して、誰とも衝突しないようにする。<br />
				Box2Dのソースから追って、filterを再度ゲットできるところを探したんだけど、<br />
				これでよかったんだろうか。</p>
				<div class="igBar"><span id="lactionscript-5"><a href="#" onclick="javascript:showPlainTxt('actionscript-5'); return false;">&gt;&gt;text</a></span></div>
				<div class="syntax_hilite"><span class="langName">ACTIONSCRIPT:</span>
				<div id="actionscript-5">
				<div class="actionscript">
				<ol start="253" style="margin:0px; padding:0px" >
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><span style="color: #b1b100;">for</span> <span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">var</span> ce:b2ContactEdge = <span style="color: #0066CC;">floor</span>.<span style="color: #006600;">m_contactList</span>; ce != <span style="color: #000000; font-weight: bold;">null</span>; ce = ce.<span style="color: #006600;">next</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>&nbsp; </li>
				<li style="color:#26536A;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">var</span> obj1:b2Body = ce.<span style="color: #006600;">contact</span>.<span style="color: #006600;">GetShape1</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">m_body</span>;<span style="color: #808080; font-style: italic;">//1つ目のオブジェクト </span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">var</span> obj2:b2Body = ce.<span style="color: #006600;">contact</span>.<span style="color: #006600;">GetShape2</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">m_body</span>;<span style="color: #808080; font-style: italic;">//2つ目のオブジェクト</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; <span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span>obj1.<span style="color: #006600;">m_userData</span> &amp;&amp; obj2.<span style="color: #006600;">m_userData</span> &amp;&amp; ce.<span style="color: #006600;">contact</span>.<span style="color: #006600;">GetManifoldCount</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> == <span style="color: #cc66cc;color:#800000;">1</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>&nbsp; </li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span>obj2.<span style="color: #006600;">m_userData</span>.<span style="color: #006600;">id</span> == <span style="color: #ff0000;">"dropbox"</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>obj2.<span style="color: #006600;">m_userData</span>.<span style="color: #006600;">crash</span>&gt; <span style="color: #cc66cc;color:#800000;">2</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; shape = obj2.<span style="color: #006600;">GetShapeList</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; shape.<span style="color: #006600;">m_filter</span>.<span style="color: #006600;">maskBits</span> = 0x00;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><span style="color: #b1b100;">else</span> <span style="color: #66cc66;">&#123;</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; obj2.<span style="color: #006600;">m_userData</span>.<span style="color: #006600;">crash</span>++;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span>&nbsp; </li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></li>
				<li style="color:#26536A;"><span style="color: #66cc66;">&#125;</span> </li>
				</ol>
				</div>
				</div>
				</div>
				<p>だいぶ作りたいものに近づいてきました！<br />
				次はShapeで絵をちゃんと重ねよう！</p>
				<p>↓ソース全部<br />
				<span id="more-35"></span></p>
				<div class="igBar"><span id="lactionscript-6"><a href="#" onclick="javascript:showPlainTxt('actionscript-6'); return false;">&gt;&gt;text</a></span></div>
				<div class="syntax_hilite"><span class="langName">ACTIONSCRIPT:</span>
				<div id="actionscript-6">
				<div class="actionscript">
				<ol style="margin:0px; padding:0px" >
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">package src <span style="color: #66cc66;">&#123;</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; <span style="color: #0066CC;">import</span> Box2D.<span style="color: #006600;">Collision</span>.<span style="color: #006600;">b2AABB</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; <span style="color: #0066CC;">import</span> Box2D.<span style="color: #006600;">Collision</span>.<span style="color: #006600;">b2ContactID</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; <span style="color: #0066CC;">import</span> Box2D.<span style="color: #006600;">Collision</span>.<span style="color: #006600;">Shapes</span>.<span style="color: #006600;">b2CircleDef</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; <span style="color: #0066CC;">import</span> Box2D.<span style="color: #006600;">Collision</span>.<span style="color: #006600;">Shapes</span>.<span style="color: #006600;">b2PolygonDef</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; <span style="color: #0066CC;">import</span> Box2D.<span style="color: #006600;">Collision</span>.<span style="color: #006600;">Shapes</span>.<span style="color: #006600;">b2Shape</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; <span style="color: #0066CC;">import</span> Box2D.<span style="color: #006600;">Common</span>.<span style="color: #0066CC;">Math</span>.<span style="color: #006600;">b2Vec2</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; <span style="color: #0066CC;">import</span> Box2D.<span style="color: #006600;">Dynamics</span>.<span style="color: #006600;">b2Body</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; <span style="color: #0066CC;">import</span> Box2D.<span style="color: #006600;">Dynamics</span>.<span style="color: #006600;">b2BodyDef</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; <span style="color: #0066CC;">import</span> Box2D.<span style="color: #006600;">Dynamics</span>.<span style="color: #006600;">b2DebugDraw</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; <span style="color: #0066CC;">import</span> Box2D.<span style="color: #006600;">Dynamics</span>.<span style="color: #006600;">b2World</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; <span style="color: #0066CC;">import</span> Box2D.<span style="color: #006600;">Dynamics</span>.<span style="color: #006600;">Contacts</span>.<span style="color: #006600;">b2ContactEdge</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; <span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">display</span>.<span style="color: #006600;">Sprite</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; <span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">events</span>.<span style="color: #006600;">Event</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; <span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">events</span>.<span style="color: #006600;">KeyboardEvent</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; <span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">events</span>.<span style="color: #006600;">MouseEvent</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; <span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">events</span>.<span style="color: #006600;">TextEvent</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; <span style="color: #0066CC;">import</span> flash.<span style="color: #0066CC;">text</span>.<span style="color: #0066CC;">TextField</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; <span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">ui</span>.<span style="color: #006600;">Keyboard</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; <span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">utils</span>.*;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; </li>
				<li style="color:#26536A;">&nbsp; &nbsp; <span style="color: #808080; font-style: italic;">/**</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><span style="color: #808080; font-style: italic;">&nbsp; &nbsp; * @author okm</span></li>
				<li style="color:#26536A;"><span style="color: #808080; font-style: italic;">&nbsp; &nbsp; */</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">class</span> LabyrinsSuite <span style="color: #0066CC;">extends</span> Sprite<span style="color: #66cc66;">&#123;</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> world:b2World;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> square:b2Body;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> <span style="color: #0066CC;">floor</span>:b2Body;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; </li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> LabyrinsSuite<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">var</span> <span style="color: #0066CC;">textField</span>:<span style="color: #0066CC;">TextField</span> = <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #0066CC;">TextField</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">textField</span>.<span style="color: #0066CC;">text</span> = <span style="color: #ff0000;">"click me "</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">textField</span>.<span style="color: #006600;">x</span> = <span style="color: #cc66cc;color:#800000;">100</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">textField</span>.<span style="color: #006600;">y</span> = <span style="color: #cc66cc;color:#800000;">100</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">textField</span>.<span style="color: #0066CC;">selectable</span> = <span style="color: #000000; font-weight: bold;">false</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">this</span>.<span style="color: #006600;">addChild</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">textField</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">stage</span>.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>MouseEvent.<span style="color: #006600;">CLICK</span>, go<span style="color: #66cc66;">&#41;</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; </li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> go<span style="color: #66cc66;">&#40;</span>event:MouseEvent<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">stage</span>.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>KeyboardEvent.<span style="color: #006600;">KEY_DOWN</span>, keyDownHandler<span style="color: #66cc66;">&#41;</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">stage</span>.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>KeyboardEvent.<span style="color: #006600;">KEY_UP</span>, keyUpHandler<span style="color: #66cc66;">&#41;</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">////////////////////////////////////////</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">// 物理エンジンのセットアップ</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">// 縦横２００メートルの世界を作成</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">var</span> worldAABB:b2AABB = <span style="color: #000000; font-weight: bold;">new</span> b2AABB<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; worldAABB.<span style="color: #006600;">lowerBound</span>.<span style="color: #0066CC;">Set</span><span style="color: #66cc66;">&#40;</span>-<span style="color: #cc66cc;color:#800000;">100</span>, -<span style="color: #cc66cc;color:#800000;">100</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; worldAABB.<span style="color: #006600;">upperBound</span>.<span style="color: #0066CC;">Set</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;color:#800000;">100</span>, <span style="color: #cc66cc;color:#800000;">100</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">// 重力を下方向に10m/s^2とする</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">var</span> gravity:b2Vec2 = <span style="color: #000000; font-weight: bold;">new</span> b2Vec2<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;color:#800000;">0</span>, <span style="color: #cc66cc;color:#800000;">10</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">// 外枠と重力を指定して、物理エンジン全体をセットアップする</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; world = <span style="color: #000000; font-weight: bold;">new</span> b2World<span style="color: #66cc66;">&#40;</span>worldAABB, gravity, <span style="color: #000000; font-weight: bold;">true</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">/////////////////////////////////////////////</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">// 部屋の作成 横幅 12M 高さ 8M の部屋を作成</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">/////////////////////////////////////////////</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">// 床</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">// 天井の高さは 8M 床の 中心X座標は　7.5M(真ん中)</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">var</span> floorBodyDef:b2BodyDef = <span style="color: #000000; font-weight: bold;">new</span> b2BodyDef<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">// 床のIDを floor としておく</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; floorBodyDef.<span style="color: #006600;">userData</span> = <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #0066CC;">Object</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; floorBodyDef.<span style="color: #006600;">userData</span>.<span style="color: #006600;">id</span> = <span style="color: #ff0000;">"floor"</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; floorBodyDef.<span style="color: #0066CC;">position</span>.<span style="color: #0066CC;">Set</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;color:#800000;">6</span>, <span style="color: #cc66cc;color:#800000;">8</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">// 床の形を、幅12m、厚さ20cmとする</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">// 指定するのはその半分の値</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">var</span> floorShapeDef:b2PolygonDef = <span style="color: #000000; font-weight: bold;">new</span> b2PolygonDef<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; floorShapeDef.<span style="color: #006600;">friction</span> = <span style="color: #cc66cc;color:#800000;">0</span>.<span style="color: #cc66cc;color:#800000;">1</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; floorShapeDef.<span style="color: #006600;">SetAsBox</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;color:#800000;">6</span>, <span style="color: #cc66cc;color:#800000;">0</span>.<span style="color: #cc66cc;color:#800000;">1</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">// 床のcategoryBits/maskBits</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; floorShapeDef.<span style="color: #006600;">filter</span>.<span style="color: #006600;">maskBits</span> = 0x01;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; floorShapeDef.<span style="color: #006600;">filter</span>.<span style="color: #006600;">categoryBits</span> = 0x01;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">// 床を動かない物体として作る</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">floor</span> = world.<span style="color: #006600;">CreateBody</span><span style="color: #66cc66;">&#40;</span>floorBodyDef<span style="color: #66cc66;">&#41;</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">floor</span>.<span style="color: #006600;">CreateShape</span><span style="color: #66cc66;">&#40;</span>floorShapeDef<span style="color: #66cc66;">&#41;</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">// 両端の壁　高さは 8M 幅 10cm</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">// 左壁</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">var</span> leftWallBodyDef:b2BodyDef = <span style="color: #000000; font-weight: bold;">new</span> b2BodyDef<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; leftWallBodyDef.<span style="color: #006600;">userData</span> = <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #0066CC;">Object</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; leftWallBodyDef.<span style="color: #006600;">userData</span>.<span style="color: #006600;">id</span> = <span style="color: #ff0000;">"left"</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; leftWallBodyDef.<span style="color: #0066CC;">position</span>.<span style="color: #0066CC;">Set</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;color:#800000;">0</span>.<span style="color: #cc66cc;color:#800000;">05</span>, <span style="color: #cc66cc;color:#800000;">4</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">var</span> wallShapeDef:b2PolygonDef = <span style="color: #000000; font-weight: bold;">new</span> b2PolygonDef<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; wallShapeDef.<span style="color: #006600;">friction</span> = <span style="color: #cc66cc;color:#800000;">0</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; wallShapeDef.<span style="color: #006600;">SetAsBox</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;color:#800000;">0</span>.<span style="color: #cc66cc;color:#800000;">05</span>, <span style="color: #cc66cc;color:#800000;">4</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">var</span> leftWall:b2Body = world.<span style="color: #006600;">CreateBody</span><span style="color: #66cc66;">&#40;</span>leftWallBodyDef<span style="color: #66cc66;">&#41;</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; leftWall.<span style="color: #006600;">CreateShape</span><span style="color: #66cc66;">&#40;</span>wallShapeDef<span style="color: #66cc66;">&#41;</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">// 右壁</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">var</span> rightWallBodyDef:b2BodyDef = <span style="color: #000000; font-weight: bold;">new</span> b2BodyDef<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; rightWallBodyDef.<span style="color: #006600;">userData</span> = <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #0066CC;">Object</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; rightWallBodyDef.<span style="color: #006600;">userData</span>.<span style="color: #006600;">id</span> = <span style="color: #ff0000;">"right"</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; rightWallBodyDef.<span style="color: #0066CC;">position</span>.<span style="color: #0066CC;">Set</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;color:#800000;">11</span>.<span style="color: #cc66cc;color:#800000;">95</span>, <span style="color: #cc66cc;color:#800000;">4</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">var</span> rightWall:b2Body = world.<span style="color: #006600;">CreateBody</span><span style="color: #66cc66;">&#40;</span>rightWallBodyDef<span style="color: #66cc66;">&#41;</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; rightWall.<span style="color: #006600;">CreateShape</span><span style="color: #66cc66;">&#40;</span>wallShapeDef<span style="color: #66cc66;">&#41;</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">////////////////////////////////////////</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">// 箱生命体</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">////////////////////////////////////////</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">// 箱の位置を左から2.5m、上から1mとする</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">var</span> boxBodyDef:b2BodyDef = <span style="color: #000000; font-weight: bold;">new</span> b2BodyDef<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; boxBodyDef.<span style="color: #006600;">userData</span> = <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #0066CC;">Object</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; boxBodyDef.<span style="color: #006600;">userData</span>.<span style="color: #006600;">id</span> = <span style="color: #ff0000;">"hako"</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; boxBodyDef.<span style="color: #0066CC;">position</span>.<span style="color: #0066CC;">Set</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;color:#800000;">2</span>.<span style="color: #cc66cc;color:#800000;">5</span>, <span style="color: #cc66cc;color:#800000;">1</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">// 箱の幅 60cm 高さ 1M　重さは 30kg とする</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">var</span> boxShapeDef:b2PolygonDef= <span style="color: #000000; font-weight: bold;">new</span> b2PolygonDef<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">//boxShapeDef.SetAsOrientedBox(0.3, 0.2, new b2Vec2(0, 0), 0.8);</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; boxShapeDef.<span style="color: #006600;">SetAsBox</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;color:#800000;">0</span>.<span style="color: #cc66cc;color:#800000;">6</span>, <span style="color: #cc66cc;color:#800000;">1</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; boxShapeDef.<span style="color: #006600;">density</span> = <span style="color: #cc66cc;color:#800000;">50</span>;&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">// 密度 [kg/m^2] 30/0.6*1</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; boxShapeDef.<span style="color: #006600;">friction</span> = <span style="color: #cc66cc;color:#800000;">0</span>.<span style="color: #cc66cc;color:#800000;">2</span>;&nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">// 摩擦係数</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; boxShapeDef.<span style="color: #006600;">restitution</span> = <span style="color: #cc66cc;color:#800000;">0</span>.<span style="color: #cc66cc;color:#800000;">3</span>;&nbsp; &nbsp;<span style="color: #808080; font-style: italic;">// 反発係数、通常は0～1</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">// 箱を動く物体として作る</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">var</span> boxBody:b2Body = world.<span style="color: #006600;">CreateBody</span><span style="color: #66cc66;">&#40;</span>boxBodyDef<span style="color: #66cc66;">&#41;</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; boxBody.<span style="color: #006600;">CreateShape</span><span style="color: #66cc66;">&#40;</span>boxShapeDef<span style="color: #66cc66;">&#41;</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">// SetMassFromShapes で重力が有効になる</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; boxBody.<span style="color: #006600;">SetMassFromShapes</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; square = boxBody;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">////////////////////////////////////////</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">// 描画設定</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">var</span> debugDraw:b2DebugDraw = <span style="color: #000000; font-weight: bold;">new</span> b2DebugDraw<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; debugDraw.<span style="color: #006600;">m_sprite</span> = <span style="color: #0066CC;">this</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; debugDraw.<span style="color: #006600;">m_drawScale</span> = <span style="color: #cc66cc;color:#800000;">45</span>; <span style="color: #808080; font-style: italic;">// 1mを45ピクセルにする</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; debugDraw.<span style="color: #006600;">m_fillAlpha</span> = <span style="color: #cc66cc;color:#800000;">0</span>.<span style="color: #cc66cc;color:#800000;">3</span>; <span style="color: #808080; font-style: italic;">// 不透明度</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; debugDraw.<span style="color: #006600;">m_lineThickness</span> = <span style="color: #cc66cc;color:#800000;">1</span>; <span style="color: #808080; font-style: italic;">// 線の太さ</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; debugDraw.<span style="color: #006600;">m_drawFlags</span> = b2DebugDraw.<span style="color: #006600;">e_shapeBit</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; world.<span style="color: #006600;">SetDebugDraw</span><span style="color: #66cc66;">&#40;</span>debugDraw<span style="color: #66cc66;">&#41;</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">this</span>.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>Event.<span style="color: #006600;">ENTER_FRAME</span>, enterFrameHandler<span style="color: #66cc66;">&#41;</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">setInterval</span><span style="color: #66cc66;">&#40;</span>dropBox, <span style="color: #cc66cc;color:#800000;">700</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; </li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> dropBox<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">var</span> dropbox_x:<span style="color: #0066CC;">Number</span> = <span style="color: #0066CC;">this</span>.<span style="color: #006600;">xRandomInt</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;color:#800000;">11</span>, <span style="color: #cc66cc;color:#800000;">1</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">var</span> dropboxBodyDef:b2BodyDef = <span style="color: #000000; font-weight: bold;">new</span> b2BodyDef<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; dropboxBodyDef.<span style="color: #006600;">userData</span> = <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #0066CC;">Object</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; dropboxBodyDef.<span style="color: #006600;">userData</span>.<span style="color: #006600;">id</span> = <span style="color: #ff0000;">"dropbox"</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; dropboxBodyDef.<span style="color: #006600;">userData</span>.<span style="color: #006600;">crash</span> = <span style="color: #cc66cc;color:#800000;">0</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; dropboxBodyDef.<span style="color: #006600;">angle</span> = <span style="color: #0066CC;">this</span>.<span style="color: #006600;">xRandomInt</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;color:#800000;">5</span>, <span style="color: #cc66cc;color:#800000;">0</span><span style="color: #66cc66;">&#41;</span> / <span style="color: #cc66cc;color:#800000;">10</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; dropboxBodyDef.<span style="color: #0066CC;">position</span>.<span style="color: #0066CC;">Set</span><span style="color: #66cc66;">&#40;</span>dropbox_x, <span style="color: #cc66cc;color:#800000;">0</span>.<span style="color: #cc66cc;color:#800000;">5</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">// 箱の幅 15cm 高さ 15cm　重さは 1kg とする</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">var</span> dropboxShapeDef:b2PolygonDef= <span style="color: #000000; font-weight: bold;">new</span> b2PolygonDef<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">//boxShapeDef.SetAsOrientedBox(0.3, 0.2, new b2Vec2(0, 0), 0.8);</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; dropboxShapeDef.<span style="color: #006600;">SetAsBox</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;color:#800000;">0</span>.<span style="color: #cc66cc;color:#800000;">15</span>, <span style="color: #cc66cc;color:#800000;">0</span>.<span style="color: #cc66cc;color:#800000;">15</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; dropboxShapeDef.<span style="color: #006600;">density</span> = <span style="color: #cc66cc;color:#800000;">25</span>;&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">// 密度</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; dropboxShapeDef.<span style="color: #006600;">friction</span> = <span style="color: #cc66cc;color:#800000;">0</span>.<span style="color: #cc66cc;color:#800000;">2</span>;&nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">// 摩擦係数</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; dropboxShapeDef.<span style="color: #006600;">restitution</span> = <span style="color: #cc66cc;color:#800000;">0</span>.<span style="color: #cc66cc;color:#800000;">7</span>;&nbsp; &nbsp;<span style="color: #808080; font-style: italic;">// 反発係数、通常は0～1</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">// 箱を動く物体として作る</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">var</span> dropboxBody:b2Body = world.<span style="color: #006600;">CreateBody</span><span style="color: #66cc66;">&#40;</span>dropboxBodyDef<span style="color: #66cc66;">&#41;</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">//dropboxBody.CreateShape(dropboxShapeDef);</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">// SetMassFromShapes で重力が有効になる</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">//dropboxBody.SetMassFromShapes();</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">// ボールのcategoryBits/maskBits</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; dropboxShapeDef.<span style="color: #006600;">filter</span>.<span style="color: #006600;">categoryBits</span> = 0x01;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; dropboxShapeDef.<span style="color: #006600;">filter</span>.<span style="color: #006600;">maskBits</span> = 0x01;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">var</span> dropbox:b2Body = world.<span style="color: #006600;">CreateBody</span><span style="color: #66cc66;">&#40;</span>dropboxBodyDef<span style="color: #66cc66;">&#41;</span>; </li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; dropbox.<span style="color: #006600;">CreateShape</span><span style="color: #66cc66;">&#40;</span>dropboxShapeDef<span style="color: #66cc66;">&#41;</span>;&nbsp; </li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; dropbox.<span style="color: #006600;">SetMassFromShapes</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; </li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> m_InputL:<span style="color: #0066CC;">Number</span> = <span style="color: #cc66cc;color:#800000;">0</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> m_InputR:<span style="color: #0066CC;">Number</span> = <span style="color: #cc66cc;color:#800000;">0</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> m_InputS:<span style="color: #0066CC;">Number</span> = <span style="color: #cc66cc;color:#800000;">0</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> m_Dir:<span style="color: #0066CC;">Number</span> = <span style="color: #cc66cc;color:#800000;">0</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> moveTime:<span style="color: #0066CC;">Number</span> = <span style="color: #cc66cc;color:#800000;">0</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; </li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">// キーが押されたときの処理</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> keyDownHandler<span style="color: #66cc66;">&#40;</span>event:KeyboardEvent<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; square.<span style="color: #006600;">WakeUp</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span>event.<span style="color: #006600;">keyCode</span> == Keyboard.<span style="color: #0066CC;">LEFT</span> &amp;&amp; m_InputL != <span style="color: #cc66cc;color:#800000;">1</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; m_InputL = <span style="color: #cc66cc;color:#800000;">1</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; m_InputR = <span style="color: #cc66cc;color:#800000;">0</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; m_Dir = -<span style="color: #cc66cc;color:#800000;">1</span>.<span style="color: #cc66cc;color:#800000;">0</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; moveTime = <span style="color: #cc66cc;color:#800000;">0</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span>event.<span style="color: #006600;">keyCode</span> == Keyboard.<span style="color: #0066CC;">RIGHT</span> &amp;&amp; m_InputR != <span style="color: #cc66cc;color:#800000;">1</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; m_InputR = <span style="color: #cc66cc;color:#800000;">1</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; m_InputL = <span style="color: #cc66cc;color:#800000;">0</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; m_Dir = <span style="color: #cc66cc;color:#800000;">1</span>.<span style="color: #cc66cc;color:#800000;">0</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; moveTime = <span style="color: #cc66cc;color:#800000;">0</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span>event.<span style="color: #006600;">keyCode</span> == <span style="color: #cc66cc;color:#800000;">83</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span> <span style="color: #808080; font-style: italic;">// s</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; m_InputS = <span style="color: #cc66cc;color:#800000;">1</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> keyUpHandler<span style="color: #66cc66;">&#40;</span>event:KeyboardEvent<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span>event.<span style="color: #006600;">keyCode</span> == Keyboard.<span style="color: #0066CC;">LEFT</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; m_InputL = <span style="color: #cc66cc;color:#800000;">0</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span>event.<span style="color: #006600;">keyCode</span> == Keyboard.<span style="color: #0066CC;">RIGHT</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; m_InputR = <span style="color: #cc66cc;color:#800000;">0</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span>event.<span style="color: #006600;">keyCode</span> == <span style="color: #cc66cc;color:#800000;">83</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span> <span style="color: #808080; font-style: italic;">// s</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; m_InputS = <span style="color: #cc66cc;color:#800000;">0</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></li>
				<li style="color:#26536A;">&nbsp;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> enterFrameHandler<span style="color: #66cc66;">&#40;</span>event:Event<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>m_InputS == <span style="color: #cc66cc;color:#800000;">1</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; square.<span style="color: #006600;">m_linearVelocity</span>.<span style="color: #006600;">y</span> = -<span style="color: #cc66cc;color:#800000;">4</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>m_InputL&gt; <span style="color: #cc66cc;color:#800000;">0</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">var</span> leftForce:<span style="color: #0066CC;">Number</span> = <span style="color: #0066CC;">this</span>.<span style="color: #006600;">easeInOutQuad</span><span style="color: #66cc66;">&#40;</span>moveTime, <span style="color: #cc66cc;color:#800000;">0</span>.<span style="color: #cc66cc;color:#800000;">5</span>, <span style="color: #cc66cc;color:#800000;">6</span>, <span style="color: #cc66cc;color:#800000;">30</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>moveTime &lt;<span style="color: #cc66cc;color:#800000;">30</span><span style="color: #66cc66;">&#41;</span> moveTime++;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; square.<span style="color: #006600;">m_linearVelocity</span>.<span style="color: #006600;">x</span> = -leftForce;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>m_InputR&gt; <span style="color: #cc66cc;color:#800000;">0</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">var</span> rightForce:<span style="color: #0066CC;">Number</span> = <span style="color: #0066CC;">this</span>.<span style="color: #006600;">easeInOutQuad</span><span style="color: #66cc66;">&#40;</span>moveTime, <span style="color: #cc66cc;color:#800000;">0</span>.<span style="color: #cc66cc;color:#800000;">5</span>, <span style="color: #cc66cc;color:#800000;">6</span>, <span style="color: #cc66cc;color:#800000;">30</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>moveTime &lt;<span style="color: #cc66cc;color:#800000;">30</span><span style="color: #66cc66;">&#41;</span> moveTime++;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; square.<span style="color: #006600;">m_linearVelocity</span>.<span style="color: #006600;">x</span> = rightForce;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>world == <span style="color: #000000; font-weight: bold;">null</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">return</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></li>
				<li style="color:#26536A;">&nbsp;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">var</span> shape:b2Shape;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">//　衝突判定　箱生命体</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">/*&nbsp; 今回はとりあえず箱との衝突はカウントしない方向で。</span></li>
				<li style="color:#26536A;"><span style="color: #808080; font-style: italic;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; for (var ce:b2ContactEdge = square.m_contactList; ce != null; ce = ce.next) {&nbsp; </span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><span style="color: #808080; font-style: italic;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; var obj1:b2Body = ce.contact.GetShape1().m_body;//1つ目のオブジェクト </span></li>
				<li style="color:#26536A;"><span style="color: #808080; font-style: italic;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; var obj2:b2Body = ce.contact.GetShape2().m_body;//2つ目のオブジェクト</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><span style="color: #808080; font-style: italic;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if(obj1.m_userData &amp;&amp; obj2.m_userData &amp;&amp; ce.contact.GetManifoldCount() == 1){&nbsp; </span></li>
				<li style="color:#26536A;"><span style="color: #808080; font-style: italic;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (obj2.m_userData.id == &quot;dropbox&quot;) {</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><span style="color: #808080; font-style: italic;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (obj2.m_userData.crash&gt; 2){</span></li>
				<li style="color:#26536A;"><span style="color: #808080; font-style: italic;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; shape = obj2.GetShapeList();</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><span style="color: #808080; font-style: italic;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; shape.m_filter.maskBits = 0x00;</span></li>
				<li style="color:#26536A;"><span style="color: #808080; font-style: italic;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }else {</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><span style="color: #808080; font-style: italic;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; obj2.m_userData.crash++;</span></li>
				<li style="color:#26536A;"><span style="color: #808080; font-style: italic;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><span style="color: #808080; font-style: italic;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }&nbsp; </span></li>
				<li style="color:#26536A;"><span style="color: #808080; font-style: italic;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><span style="color: #808080; font-style: italic;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }</span></li>
				<li style="color:#26536A;"><span style="color: #808080; font-style: italic;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; */</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">// 衝突判定　床</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">for</span> <span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">var</span> ce:b2ContactEdge = <span style="color: #0066CC;">floor</span>.<span style="color: #006600;">m_contactList</span>; ce != <span style="color: #000000; font-weight: bold;">null</span>; ce = ce.<span style="color: #006600;">next</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>&nbsp; </li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">var</span> obj1:b2Body = ce.<span style="color: #006600;">contact</span>.<span style="color: #006600;">GetShape1</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">m_body</span>;<span style="color: #808080; font-style: italic;">//1つ目のオブジェクト </span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">var</span> obj2:b2Body = ce.<span style="color: #006600;">contact</span>.<span style="color: #006600;">GetShape2</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">m_body</span>;<span style="color: #808080; font-style: italic;">//2つ目のオブジェクト</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span>obj1.<span style="color: #006600;">m_userData</span> &amp;&amp; obj2.<span style="color: #006600;">m_userData</span> &amp;&amp; ce.<span style="color: #006600;">contact</span>.<span style="color: #006600;">GetManifoldCount</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> == <span style="color: #cc66cc;color:#800000;">1</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>&nbsp; </li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span>obj2.<span style="color: #006600;">m_userData</span>.<span style="color: #006600;">id</span> == <span style="color: #ff0000;">"dropbox"</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>obj2.<span style="color: #006600;">m_userData</span>.<span style="color: #006600;">crash</span>&gt; <span style="color: #cc66cc;color:#800000;">2</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; shape = obj2.<span style="color: #006600;">GetShapeList</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; shape.<span style="color: #006600;">m_filter</span>.<span style="color: #006600;">maskBits</span> = 0x00;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><span style="color: #b1b100;">else</span> <span style="color: #66cc66;">&#123;</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; obj2.<span style="color: #006600;">m_userData</span>.<span style="color: #006600;">crash</span>++;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span>&nbsp; </li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">// Flashはデフォルトで秒間24フレームなので、</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">// 物理シミュレーションを1/24秒進める</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; world.<span style="color: #006600;">Step</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;color:#800000;">1</span> / <span style="color: #cc66cc;color:#800000;">24</span>, <span style="color: #cc66cc;color:#800000;">10</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; </li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">/**</span></li>
				<li style="color:#26536A;"><span style="color: #808080; font-style: italic;">&nbsp; &nbsp; &nbsp; &nbsp; 　* t = time</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><span style="color: #808080; font-style: italic;">&nbsp; &nbsp; &nbsp; &nbsp; 　* b = beginning value</span></li>
				<li style="color:#26536A;"><span style="color: #808080; font-style: italic;">&nbsp; &nbsp;&nbsp; &nbsp; &nbsp;　* c = change in value</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><span style="color: #808080; font-style: italic;">&nbsp; &nbsp;&nbsp; &nbsp; &nbsp;　* d = duration</span></li>
				<li style="color:#26536A;"><span style="color: #808080; font-style: italic;">&nbsp; &nbsp;&nbsp; &nbsp; &nbsp;　*/</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> easeInOutQuad<span style="color: #66cc66;">&#40;</span>t:<span style="color: #0066CC;">Number</span>, b:<span style="color: #0066CC;">Number</span>, c:<span style="color: #0066CC;">Number</span>, d:<span style="color: #0066CC;">Number</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">Number</span> <span style="color: #66cc66;">&#123;</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#40;</span>t/=d/<span style="color: #cc66cc;color:#800000;">2</span><span style="color: #66cc66;">&#41;</span> &lt;<span style="color: #cc66cc;color:#800000;">1</span><span style="color: #66cc66;">&#41;</span> <span style="color: #b1b100;">return</span> c/<span style="color: #cc66cc;color:#800000;">2</span>*t*t + b;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">return</span> -c/<span style="color: #cc66cc;color:#800000;">2</span> * <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#40;</span>--t<span style="color: #66cc66;">&#41;</span>*<span style="color: #66cc66;">&#40;</span>t-<span style="color: #cc66cc;color:#800000;">2</span><span style="color: #66cc66;">&#41;</span> - <span style="color: #cc66cc;color:#800000;">1</span><span style="color: #66cc66;">&#41;</span> + b;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span>; </li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; </li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> xRandomInt <span style="color: #66cc66;">&#40;</span>nMax:<span style="color: #0066CC;">Number</span>, nMin:<span style="color: #0066CC;">Number</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">Number</span> <span style="color: #66cc66;">&#123;</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">// nMinからnMaxまでのランダムな整数を返す</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">var</span> nRandomInt:<span style="color: #0066CC;">Number</span> = <span style="color: #0066CC;">Math</span>.<span style="color: #0066CC;">floor</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">Math</span>.<span style="color: #0066CC;">random</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>*<span style="color: #66cc66;">&#40;</span>nMax-nMin+<span style="color: #cc66cc;color:#800000;">1</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>+nMin;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">return</span> nRandomInt;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span> </li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></li>
				<li style="color:#26536A;"><span style="color: #66cc66;">&#125;</span> </li>
				</ol>
				</div>
				</div>
				</div>
]]></content:encoded>
			<wfw:commentRss>http://parpue.net/web/35/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

