
{"id":771,"date":"2009-01-13T09:00:29","date_gmt":"2009-01-13T08:00:29","guid":{"rendered":"http:\/\/www.matthijskamstra.nl\/blog\/?p=771"},"modified":"2009-01-12T13:06:44","modified_gmt":"2009-01-12T12:06:44","slug":"hello-box2d-part-3","status":"publish","type":"post","link":"https:\/\/www.matthijskamstra.nl\/blog\/2009\/01\/13\/hello-box2d-part-3\/","title":{"rendered":"Hello box2D &#8211; part 3"},"content":{"rendered":"<p>In my <a href=\"http:\/\/www.matthijskamstra.nl\/blog\/index.php\/2009\/01\/12\/hello-box2d-part-2\/\">previous post<\/a> I update the &#8220;Hello world&#8221; for box2D so that you can see something visual happening.<br \/>\nYou can find the original here: <a href=\"http:\/\/www.box2d.org\/wiki\/index.php?title=Manual\/AS3#Hello_Box2D\">AS3: Hello Box2D<\/a>.<\/p>\n<p>Today I will make it a little bit more attractive (remove trace).<\/p>\n<p>First we change some settings to make it more fun to watch at!<\/p>\n<p>The <code>groundBodeDef<\/code> (strange name for something that is the ceiling) is moved more down so you can see where the <code>bodyDef<\/code> is bouncing off.<br \/>\n[as]<br \/>\n\/\/groundBodyDef.position.Set(0.0, -10.0);   \/\/ [mck]: old code<br \/>\ngroundBodyDef.position.Set(0.0, -9.0);<br \/>\n[\/as]<\/p>\n<p>The <code>bodyDef<\/code> is moved to the center and dropped a little higher<br \/>\n[as]<br \/>\n\/\/bodyDef.position.Set(0.0, 4.0); \t\/\/ [mck]: old code<br \/>\nbodyDef.position.Set(10.0, 10.0);<br \/>\n[\/as]<\/p>\n<p>And the <code>shapeDef<\/code> is bouncy so that you can see what box2D can do:<br \/>\n[as]<br \/>\nshapeDef.restitution = 0.8;   \/\/ [mck]: extra new code<br \/>\n[\/as]<\/p>\n<p>And delete the trace:<br \/>\n[as]<br \/>\nvar position:b2Vec2 = body.GetPosition();<br \/>\nvar angle:Number = body.GetAngle();<br \/>\ntrace(position.x +&#8217;,&#8217;+ position.y +&#8217;,&#8217;+ angle);<br \/>\n[\/as]<\/p>\n<h3>End result<\/h3>\n<p>The document class (<code>HelloWorld.as<\/code>) will look like this:<\/p>\n<p>[as]<br \/>\npackage {<\/p>\n<p>\timport flash.display.*;<br \/>\n\timport flash.events.*;<br \/>\n\t\/\/ Box2D Classes used in this &#8220;Hello world&#8221;<br \/>\n\timport Box2D.Dynamics.*;<br \/>\n\timport Box2D.Collision.*;<br \/>\n\timport Box2D.Collision.Shapes.*;<br \/>\n\timport Box2D.Common.Math.*;<\/p>\n<p>\t\/\/ [SWF(width=&#8221;640&#8243;, height=&#8221;480&#8243;, backgroundColor=&#8221;#000000&#8243;, frameRate=&#8221;60&#8243;)]<br \/>\n\tpublic class HelloWorld extends Sprite {<\/p>\n<p>\t\tprivate var body:b2Body;<br \/>\n\t\tprivate var world:b2World;<\/p>\n<p>\t\t\/\/ constructor<br \/>\n\t\tpublic function HelloWorld() {<br \/>\n\t\t\ttrace( &#8220;HelloWorld.HelloWorld&#8221; );<\/p>\n<p>\t\t\t\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/<br \/>\n\t\t\t\/\/ http:\/\/www.box2d.org\/wiki\/index.php?title=Manual\/AS3#Creating_a_World<br \/>\n\t\t\t\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/<br \/>\n\t\t\t\/\/ Create world AABB<br \/>\n\t\t\tvar worldAABB:b2AABB = new b2AABB();<br \/>\n\t\t\tworldAABB.lowerBound.Set(-100.0, -100.0);<br \/>\n\t\t\tworldAABB.upperBound.Set(100.0, 100.0);<\/p>\n<p>\t\t\t\/\/ Define the gravity vector<br \/>\n\t\t\tvar gravity:b2Vec2 = new b2Vec2 (0.0, -10.0); <\/p>\n<p>\t\t\t\/\/ Allow bodies to sleep<br \/>\n\t\t\tvar doSleep:Boolean = true;<\/p>\n<p>\t\t\t\/\/ Construct a world object<br \/>\n\t\t\t\/\/ var world:b2World = new b2World(worldAABB, gravity, doSleep);  \/\/ [mck]: old code<br \/>\n\t\t\tworld = new b2World(worldAABB, gravity, doSleep);<\/p>\n<p>\t\t\t\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/<br \/>\n\t\t\t\/\/ http:\/\/www.box2d.org\/wiki\/index.php?title=Manual\/AS3#Creating_a_Ground_Box<br \/>\n\t\t\t\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/<br \/>\n\t\t\tvar groundBodyDef:b2BodyDef = new b2BodyDef();<br \/>\n\t\t\tgroundBodyDef.position.Set(0.0, -10.0);<\/p>\n<p>\t\t\tvar groundBody:b2Body = world.CreateBody(groundBodyDef);<\/p>\n<p>\t\t\tvar groundShapeDef:b2PolygonDef = new b2PolygonDef();<br \/>\n\t\t\tgroundShapeDef.SetAsBox(50.0, 10.0);<\/p>\n<p>\t\t\tgroundBody.CreateShape(groundShapeDef);<\/p>\n<p>\t\t\t\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/<br \/>\n\t\t\t\/\/ http:\/\/www.box2d.org\/wiki\/index.php?title=Manual\/AS3#Creating_a_Dynamic_Body<br \/>\n\t\t\t\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/<br \/>\n\t\t\tvar bodyDef:b2BodyDef = new b2BodyDef();<br \/>\n\t\t\tbodyDef.position.Set(0.0, 4.0);<br \/>\n\t\t\t\/\/ var body:b2Body = world.CreateBody(bodyDef);   \/\/ [mck]: old code<br \/>\n\t\t\tbody = world.CreateBody(bodyDef);<\/p>\n<p>\t\t\tvar shapeDef:b2PolygonDef = new b2PolygonDef();<br \/>\n\t\t\tshapeDef.SetAsBox(1.0, 1.0);<br \/>\n\t\t\tshapeDef.density = 1.0;<br \/>\n\t\t\tshapeDef.friction = 0.3;<br \/>\n\t\t\tbody.CreateShape(shapeDef);<br \/>\n\t\t\tbody.SetMassFromShapes();<\/p>\n<p>\t\t\t\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/<br \/>\n\t\t\t\/\/ http:\/\/www.box2d.org\/wiki\/index.php?title=Manual\/AS3#Debug_Drawing<br \/>\n\t\t\t\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/<br \/>\n\t\t\tvar debugDraw:b2DebugDraw = new b2DebugDraw();<br \/>\n\t\t\tdebugDraw.m_sprite = new Sprite();<\/p>\n<p>\t\t\taddChild(debugDraw.m_sprite);<\/p>\n<p>\t\t\tdebugDraw.m_drawScale = 30;<br \/>\n\t\t\tdebugDraw.m_fillAlpha = .25;<br \/>\n\t\t\tdebugDraw.m_lineThickness = 1;<br \/>\n\t\t\tdebugDraw.m_drawFlags = b2DebugDraw.e_shapeBit | b2DebugDraw.e_jointBit ;<br \/>\n\t\t\tworld.SetDebugDraw (debugDraw);<\/p>\n<p>\t\t\t\/\/<br \/>\n\t\t\taddEventListener(Event.ENTER_FRAME, onUpdateHandler, false, 0, true);<br \/>\n\t\t}<\/p>\n<p>\t\t\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/<br \/>\n\t\t\/\/ http:\/\/www.box2d.org\/wiki\/index.php?title=Manual\/AS3#Simulating_the_World_.28of_Box2D.29<br \/>\n\t\t\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/<br \/>\n\t\tpublic function onUpdateHandler(e:Event):void{<\/p>\n<p>\t\t\tvar timeStep:Number = 1.0 \/ 60.0;<br \/>\n\t\t\tvar iterations:Number = 10;<\/p>\n<p>\t\t\tworld.Step(timeStep, iterations);<\/p>\n<p>\t\t}<\/p>\n<p>\t} \/\/ end class<\/p>\n<p>} \/\/ end package<\/p>\n<p>[\/as]<\/p>\n<p>So all you need to do is CTRL+ENTER.<\/p>\n<p>And you will have something like this:<\/p>\n<div class=\"flash\">[swf]http:\/\/www.matthijskamstra.nl\/blog\/wp-content\/uploads\/helloworldbox2d_nice.swf,520, 390[\/swf]<\/div>\n<p>Is this it? No, lets make it better.<br \/>\nTomorrow more<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In my previous post I update the &#8220;Hello world&#8221; for box2D so that you can see something visual happening. You can find the original here: AS3: Hello Box2D. Today I will make it a little bit more attractive (remove trace). First we change some settings to make it more fun to watch at! The groundBodeDef [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[22,3],"tags":[408,230,231,398,159],"class_list":["post-771","post","type-post","status-publish","format-standard","hentry","category-as3","category-flash","tag-as3","tag-box2d","tag-box2dflash","tag-flash","tag-flashdevelop"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 4.9.10 - aioseo.com -->\n\t<meta name=\"description\" content=\"In my previous post I update the &quot;Hello world&quot; for box2D so that you can see something visual happening. You can find the original here: AS3: Hello Box2D. Today I will make it a little bit more attractive (remove trace). First we change some settings to make it more fun to watch at! The groundBodeDef\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"Matthijs Kamstra\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/www.matthijskamstra.nl\/blog\/2009\/01\/13\/hello-box2d-part-3\/\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 4.9.10\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"[mck] | a polymath zapper\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"Hello box2D \u2013 part 3 | [mck]\" \/>\n\t\t<meta property=\"og:description\" content=\"In my previous post I update the &quot;Hello world&quot; for box2D so that you can see something visual happening. You can find the original here: AS3: Hello Box2D. Today I will make it a little bit more attractive (remove trace). First we change some settings to make it more fun to watch at! The groundBodeDef\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/www.matthijskamstra.nl\/blog\/2009\/01\/13\/hello-box2d-part-3\/\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2009-01-13T08:00:29+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2009-01-12T12:06:44+00:00\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n\t\t<meta name=\"twitter:title\" content=\"Hello box2D \u2013 part 3 | [mck]\" \/>\n\t\t<meta name=\"twitter:description\" content=\"In my previous post I update the &quot;Hello world&quot; for box2D so that you can see something visual happening. You can find the original here: AS3: Hello Box2D. Today I will make it a little bit more attractive (remove trace). First we change some settings to make it more fun to watch at! The groundBodeDef\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.matthijskamstra.nl\\\/blog\\\/2009\\\/01\\\/13\\\/hello-box2d-part-3\\\/#article\",\"name\":\"Hello box2D \\u2013 part 3 | [mck]\",\"headline\":\"Hello box2D &#8211; part 3\",\"author\":{\"@id\":\"https:\\\/\\\/www.matthijskamstra.nl\\\/blog\\\/author\\\/admin\\\/#author\"},\"publisher\":{\"@id\":\"https:\\\/\\\/www.matthijskamstra.nl\\\/blog\\\/#organization\"},\"datePublished\":\"2009-01-13T09:00:29+01:00\",\"dateModified\":\"2009-01-12T13:06:44+01:00\",\"inLanguage\":\"en-US\",\"commentCount\":1,\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.matthijskamstra.nl\\\/blog\\\/2009\\\/01\\\/13\\\/hello-box2d-part-3\\\/#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.matthijskamstra.nl\\\/blog\\\/2009\\\/01\\\/13\\\/hello-box2d-part-3\\\/#webpage\"},\"articleSection\":\"AS3, Flash, AS3, box2d, box2dFlash, Flash, flashdevelop\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.matthijskamstra.nl\\\/blog\\\/2009\\\/01\\\/13\\\/hello-box2d-part-3\\\/#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.matthijskamstra.nl\\\/blog#listItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.matthijskamstra.nl\\\/blog\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.matthijskamstra.nl\\\/blog\\\/category\\\/flash\\\/#listItem\",\"name\":\"Flash\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.matthijskamstra.nl\\\/blog\\\/category\\\/flash\\\/#listItem\",\"position\":2,\"name\":\"Flash\",\"item\":\"https:\\\/\\\/www.matthijskamstra.nl\\\/blog\\\/category\\\/flash\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.matthijskamstra.nl\\\/blog\\\/category\\\/flash\\\/as3\\\/#listItem\",\"name\":\"AS3\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.matthijskamstra.nl\\\/blog#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.matthijskamstra.nl\\\/blog\\\/category\\\/flash\\\/as3\\\/#listItem\",\"position\":3,\"name\":\"AS3\",\"item\":\"https:\\\/\\\/www.matthijskamstra.nl\\\/blog\\\/category\\\/flash\\\/as3\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.matthijskamstra.nl\\\/blog\\\/2009\\\/01\\\/13\\\/hello-box2d-part-3\\\/#listItem\",\"name\":\"Hello box2D &#8211; part 3\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.matthijskamstra.nl\\\/blog\\\/category\\\/flash\\\/#listItem\",\"name\":\"Flash\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.matthijskamstra.nl\\\/blog\\\/2009\\\/01\\\/13\\\/hello-box2d-part-3\\\/#listItem\",\"position\":4,\"name\":\"Hello box2D &#8211; part 3\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.matthijskamstra.nl\\\/blog\\\/category\\\/flash\\\/as3\\\/#listItem\",\"name\":\"AS3\"}}]},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.matthijskamstra.nl\\\/blog\\\/#organization\",\"name\":\"[mck]\",\"description\":\"a polymath zapper\",\"url\":\"https:\\\/\\\/www.matthijskamstra.nl\\\/blog\\\/\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.matthijskamstra.nl\\\/blog\\\/author\\\/admin\\\/#author\",\"url\":\"https:\\\/\\\/www.matthijskamstra.nl\\\/blog\\\/author\\\/admin\\\/\",\"name\":\"Matthijs Kamstra\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/www.matthijskamstra.nl\\\/blog\\\/2009\\\/01\\\/13\\\/hello-box2d-part-3\\\/#authorImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/06ff22a1197b6624946e5a3377184f11ddc00ac06a6f1d2311b9d2072bdf61b1?s=96&d=wavatar&r=g\",\"width\":96,\"height\":96,\"caption\":\"Matthijs Kamstra\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.matthijskamstra.nl\\\/blog\\\/2009\\\/01\\\/13\\\/hello-box2d-part-3\\\/#webpage\",\"url\":\"https:\\\/\\\/www.matthijskamstra.nl\\\/blog\\\/2009\\\/01\\\/13\\\/hello-box2d-part-3\\\/\",\"name\":\"Hello box2D \\u2013 part 3 | [mck]\",\"description\":\"In my previous post I update the \\\"Hello world\\\" for box2D so that you can see something visual happening. You can find the original here: AS3: Hello Box2D. Today I will make it a little bit more attractive (remove trace). First we change some settings to make it more fun to watch at! The groundBodeDef\",\"inLanguage\":\"en-US\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.matthijskamstra.nl\\\/blog\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.matthijskamstra.nl\\\/blog\\\/2009\\\/01\\\/13\\\/hello-box2d-part-3\\\/#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/www.matthijskamstra.nl\\\/blog\\\/author\\\/admin\\\/#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/www.matthijskamstra.nl\\\/blog\\\/author\\\/admin\\\/#author\"},\"datePublished\":\"2009-01-13T09:00:29+01:00\",\"dateModified\":\"2009-01-12T13:06:44+01:00\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.matthijskamstra.nl\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.matthijskamstra.nl\\\/blog\\\/\",\"name\":\"[mck]\",\"description\":\"a polymath zapper\",\"inLanguage\":\"en-US\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.matthijskamstra.nl\\\/blog\\\/#organization\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"Hello box2D \u2013 part 3 | [mck]","description":"In my previous post I update the \"Hello world\" for box2D so that you can see something visual happening. You can find the original here: AS3: Hello Box2D. Today I will make it a little bit more attractive (remove trace). First we change some settings to make it more fun to watch at! The groundBodeDef","canonical_url":"https:\/\/www.matthijskamstra.nl\/blog\/2009\/01\/13\/hello-box2d-part-3\/","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.matthijskamstra.nl\/blog\/2009\/01\/13\/hello-box2d-part-3\/#article","name":"Hello box2D \u2013 part 3 | [mck]","headline":"Hello box2D &#8211; part 3","author":{"@id":"https:\/\/www.matthijskamstra.nl\/blog\/author\/admin\/#author"},"publisher":{"@id":"https:\/\/www.matthijskamstra.nl\/blog\/#organization"},"datePublished":"2009-01-13T09:00:29+01:00","dateModified":"2009-01-12T13:06:44+01:00","inLanguage":"en-US","commentCount":1,"mainEntityOfPage":{"@id":"https:\/\/www.matthijskamstra.nl\/blog\/2009\/01\/13\/hello-box2d-part-3\/#webpage"},"isPartOf":{"@id":"https:\/\/www.matthijskamstra.nl\/blog\/2009\/01\/13\/hello-box2d-part-3\/#webpage"},"articleSection":"AS3, Flash, AS3, box2d, box2dFlash, Flash, flashdevelop"},{"@type":"BreadcrumbList","@id":"https:\/\/www.matthijskamstra.nl\/blog\/2009\/01\/13\/hello-box2d-part-3\/#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/www.matthijskamstra.nl\/blog#listItem","position":1,"name":"Home","item":"https:\/\/www.matthijskamstra.nl\/blog","nextItem":{"@type":"ListItem","@id":"https:\/\/www.matthijskamstra.nl\/blog\/category\/flash\/#listItem","name":"Flash"}},{"@type":"ListItem","@id":"https:\/\/www.matthijskamstra.nl\/blog\/category\/flash\/#listItem","position":2,"name":"Flash","item":"https:\/\/www.matthijskamstra.nl\/blog\/category\/flash\/","nextItem":{"@type":"ListItem","@id":"https:\/\/www.matthijskamstra.nl\/blog\/category\/flash\/as3\/#listItem","name":"AS3"},"previousItem":{"@type":"ListItem","@id":"https:\/\/www.matthijskamstra.nl\/blog#listItem","name":"Home"}},{"@type":"ListItem","@id":"https:\/\/www.matthijskamstra.nl\/blog\/category\/flash\/as3\/#listItem","position":3,"name":"AS3","item":"https:\/\/www.matthijskamstra.nl\/blog\/category\/flash\/as3\/","nextItem":{"@type":"ListItem","@id":"https:\/\/www.matthijskamstra.nl\/blog\/2009\/01\/13\/hello-box2d-part-3\/#listItem","name":"Hello box2D &#8211; part 3"},"previousItem":{"@type":"ListItem","@id":"https:\/\/www.matthijskamstra.nl\/blog\/category\/flash\/#listItem","name":"Flash"}},{"@type":"ListItem","@id":"https:\/\/www.matthijskamstra.nl\/blog\/2009\/01\/13\/hello-box2d-part-3\/#listItem","position":4,"name":"Hello box2D &#8211; part 3","previousItem":{"@type":"ListItem","@id":"https:\/\/www.matthijskamstra.nl\/blog\/category\/flash\/as3\/#listItem","name":"AS3"}}]},{"@type":"Organization","@id":"https:\/\/www.matthijskamstra.nl\/blog\/#organization","name":"[mck]","description":"a polymath zapper","url":"https:\/\/www.matthijskamstra.nl\/blog\/"},{"@type":"Person","@id":"https:\/\/www.matthijskamstra.nl\/blog\/author\/admin\/#author","url":"https:\/\/www.matthijskamstra.nl\/blog\/author\/admin\/","name":"Matthijs Kamstra","image":{"@type":"ImageObject","@id":"https:\/\/www.matthijskamstra.nl\/blog\/2009\/01\/13\/hello-box2d-part-3\/#authorImage","url":"https:\/\/secure.gravatar.com\/avatar\/06ff22a1197b6624946e5a3377184f11ddc00ac06a6f1d2311b9d2072bdf61b1?s=96&d=wavatar&r=g","width":96,"height":96,"caption":"Matthijs Kamstra"}},{"@type":"WebPage","@id":"https:\/\/www.matthijskamstra.nl\/blog\/2009\/01\/13\/hello-box2d-part-3\/#webpage","url":"https:\/\/www.matthijskamstra.nl\/blog\/2009\/01\/13\/hello-box2d-part-3\/","name":"Hello box2D \u2013 part 3 | [mck]","description":"In my previous post I update the \"Hello world\" for box2D so that you can see something visual happening. You can find the original here: AS3: Hello Box2D. Today I will make it a little bit more attractive (remove trace). First we change some settings to make it more fun to watch at! The groundBodeDef","inLanguage":"en-US","isPartOf":{"@id":"https:\/\/www.matthijskamstra.nl\/blog\/#website"},"breadcrumb":{"@id":"https:\/\/www.matthijskamstra.nl\/blog\/2009\/01\/13\/hello-box2d-part-3\/#breadcrumblist"},"author":{"@id":"https:\/\/www.matthijskamstra.nl\/blog\/author\/admin\/#author"},"creator":{"@id":"https:\/\/www.matthijskamstra.nl\/blog\/author\/admin\/#author"},"datePublished":"2009-01-13T09:00:29+01:00","dateModified":"2009-01-12T13:06:44+01:00"},{"@type":"WebSite","@id":"https:\/\/www.matthijskamstra.nl\/blog\/#website","url":"https:\/\/www.matthijskamstra.nl\/blog\/","name":"[mck]","description":"a polymath zapper","inLanguage":"en-US","publisher":{"@id":"https:\/\/www.matthijskamstra.nl\/blog\/#organization"}}]},"og:locale":"en_US","og:site_name":"[mck] | a polymath zapper","og:type":"article","og:title":"Hello box2D \u2013 part 3 | [mck]","og:description":"In my previous post I update the &quot;Hello world&quot; for box2D so that you can see something visual happening. You can find the original here: AS3: Hello Box2D. Today I will make it a little bit more attractive (remove trace). First we change some settings to make it more fun to watch at! The groundBodeDef","og:url":"https:\/\/www.matthijskamstra.nl\/blog\/2009\/01\/13\/hello-box2d-part-3\/","article:published_time":"2009-01-13T08:00:29+00:00","article:modified_time":"2009-01-12T12:06:44+00:00","twitter:card":"summary_large_image","twitter:title":"Hello box2D \u2013 part 3 | [mck]","twitter:description":"In my previous post I update the &quot;Hello world&quot; for box2D so that you can see something visual happening. You can find the original here: AS3: Hello Box2D. Today I will make it a little bit more attractive (remove trace). First we change some settings to make it more fun to watch at! The groundBodeDef"},"aioseo_meta_data":{"post_id":"771","title":null,"description":null,"keywords":null,"keyphrases":null,"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":null,"og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"","isEnabled":true},"graphs":[]},"schema_type":"default","schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"local_seo":null,"breadcrumb_settings":null,"limit_modified_date":false,"ai":null,"created":"2024-12-11 08:59:30","updated":"2025-06-04 09:24:32","seo_analyzer_scan_date":null},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/www.matthijskamstra.nl\/blog\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/www.matthijskamstra.nl\/blog\/category\/flash\/\" title=\"Flash\">Flash<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/www.matthijskamstra.nl\/blog\/category\/flash\/as3\/\" title=\"AS3\">AS3<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tHello box2D \u2013 part 3\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/www.matthijskamstra.nl\/blog"},{"label":"Flash","link":"https:\/\/www.matthijskamstra.nl\/blog\/category\/flash\/"},{"label":"AS3","link":"https:\/\/www.matthijskamstra.nl\/blog\/category\/flash\/as3\/"},{"label":"Hello box2D &#8211; part 3","link":"https:\/\/www.matthijskamstra.nl\/blog\/2009\/01\/13\/hello-box2d-part-3\/"}],"_links":{"self":[{"href":"https:\/\/www.matthijskamstra.nl\/blog\/wp-json\/wp\/v2\/posts\/771","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.matthijskamstra.nl\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.matthijskamstra.nl\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.matthijskamstra.nl\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.matthijskamstra.nl\/blog\/wp-json\/wp\/v2\/comments?post=771"}],"version-history":[{"count":7,"href":"https:\/\/www.matthijskamstra.nl\/blog\/wp-json\/wp\/v2\/posts\/771\/revisions"}],"predecessor-version":[{"id":774,"href":"https:\/\/www.matthijskamstra.nl\/blog\/wp-json\/wp\/v2\/posts\/771\/revisions\/774"}],"wp:attachment":[{"href":"https:\/\/www.matthijskamstra.nl\/blog\/wp-json\/wp\/v2\/media?parent=771"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.matthijskamstra.nl\/blog\/wp-json\/wp\/v2\/categories?post=771"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.matthijskamstra.nl\/blog\/wp-json\/wp\/v2\/tags?post=771"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}