
{"id":749,"date":"2009-01-11T02:26:33","date_gmt":"2009-01-11T01:26:33","guid":{"rendered":"http:\/\/www.matthijskamstra.nl\/blog\/?p=749"},"modified":"2009-02-14T14:40:43","modified_gmt":"2009-02-14T13:40:43","slug":"hello-box2d-part-1","status":"publish","type":"post","link":"https:\/\/www.matthijskamstra.nl\/blog\/2009\/01\/11\/hello-box2d-part-1\/","title":{"rendered":"Hello box2D &#8211; part 1"},"content":{"rendered":"<p>In programming the <a href=\"http:\/\/en.wikipedia.org\/wiki\/Hello_world_program\">Hello world<\/a> is probably the first you will ever make in a new language.<br \/>\nIn the box2D wiki you can find a &#8220;Hello world&#8221; in box2DFlash style: <a href=\"http:\/\/www.box2d.org\/wiki\/index.php?title=Manual\/AS3#Hello_Box2D\">AS3: Hello Box2D<\/a>.<\/p>\n<p>Easy as it should be &#8230; or is it?<br \/>\nThis is not the &#8220;Hello world&#8221; I expected, so I&#8217;ll post one that helps you more on your way.<\/p>\n<div class=\"update\">As <a href=\"http:\/\/www.matthijskamstra.nl\/blog\/index.php\/2009\/01\/11\/hello-box2d-part-1\/comment-page-1\/#comment-11372\">irongleet<\/a> mentions in the comments, this is not really a tutorial. There is already a tutorial on the page I mention above <a href=\"http:\/\/www.box2d.org\/wiki\/index.php?title=Manual\/AS3#Hello_Box2D\">AS3: Hello Box2D<\/a>. It&#8217;s not a bad tutorial, but you need to have some knowledge of AS3 to follow it <strong>and<\/strong> I personally don&#8217;t like the end result. So this is the first part of a series which will help you make more out of the previously mentioned tutorial. But I&#8217;m not going to copy past the tutorial written somewhere else and present it here. That&#8217;s why you should read the links to the source for more information. And the next <a href=\"http:\/\/www.matthijskamstra.nl\/blog\/index.php\/2009\/01\/12\/hello-box2d-part-2\/\"><strong>Hello box2d &#8211; part 2<\/strong><\/a> will have some more input from me.<\/div>\n<h3>Hello_Box2D<\/h3>\n<p><em>source: <a href=\"http:\/\/www.box2d.org\/wiki\/index.php?title=Manual\/AS3#Hello_Box2D\">Hello_Box2D<\/a><\/em><\/p>\n<p>Lets start with a Flash document width 640px, height 480px, backgroundColor=&#8221;#000000&#8243; and a framerate 60.<br \/>\nAnd add a document class: <code>HelloWorld<\/code>.<br \/>\nSave this .fla (for example <code>HelloWorldBox2d.fla<\/code>).<\/p>\n<p>Now get your favorite code-editor (I suggest <a href=\"http:\/\/www.flashdevelop.org\">FlashDevelop<\/a>) and create that document class, name it <code>HelloWorld.as<\/code>:<br \/>\n[as]<br \/>\npackage {<\/p>\n<p>\timport flash.display.Sprite;<br \/>\n\timport flash.events.Event;<br \/>\n\t\/\/ Classes used in this example<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>\tpublic class HelloWorld extends Sprite{<\/p>\n<p>\t\t\/\/ constructor<br \/>\n\t\tpublic function HelloWorld() {<br \/>\n\t\t\ttrace( &#8220;HelloWorld.HelloWorld&#8221; );<br \/>\n\t\t}<\/p>\n<p>\t} \/\/ end class<\/p>\n<p>} \/\/ end package<br \/>\n[\/as]<br \/>\nand save it next to the <code>HelloWorldBox2d.fla<\/code>.<\/p>\n<p>You can see that I already add the import needed for Box2D.<\/p>\n<p>The last thing you need to do is download the box2D classes: <a href=\"http:\/\/sourceforge.net\/projects\/box2dflash\">http:\/\/sourceforge.net\/projects\/box2dflash<\/a><br \/>\nExtract the zip file and copy the folder <code>box2d<\/code> next to the <code>HelloWorldBox2d.fla<\/code> and the <code>HelloWorld.as<\/code><\/p>\n<p>And now you are set&#8230;<\/p>\n<h3>Creating_a_World<\/h3>\n<blockquote><p>Every Box2D program begins with the creation of a world object. This is the physics hub that manages memory, objects, and simulation. <\/p><\/blockquote>\n<p><em>source: <a href=\"http:\/\/www.box2d.org\/wiki\/index.php?title=Manual\/AS3#Creating_a_World\">Creating_a_World<\/a><\/em><\/p>\n<p>The next piece of code can be placed in the constructor (public function HelloWorld() )<br \/>\n[as]<br \/>\n\/\/ Creat world AABB<br \/>\nvar worldAABB:b2AABB = new b2AABB();<br \/>\nworldAABB.lowerBound.Set(-100.0, -100.0);<br \/>\nworldAABB.upperBound.Set(100.0, 100.0);<\/p>\n<p>\/\/ Define the gravity vector<br \/>\nvar gravity:b2Vec2 = new b2Vec2 (0.0, -10.0); <\/p>\n<p>\/\/ Allow bodies to sleep<br \/>\nvar doSleep:Boolean = true;<\/p>\n<p>\/\/ Construct a world object<br \/>\nvar world:b2World = new b2World(worldAABB, gravity, doSleep);<br \/>\n[\/as]<\/p>\n<h3>Creating_a_Ground_Box<\/h3>\n<p><em>source: <a href=\"http:\/\/www.box2d.org\/wiki\/index.php?title=Manual\/AS3#Creating_a_Ground_Box\">Creating_a_Ground_Box<\/a><\/em><\/p>\n<p>[as]<br \/>\nvar groundBodyDef:b2BodyDef = new b2BodyDef();<br \/>\ngroundBodyDef.position.Set(0.0, -10.0);<\/p>\n<p>var groundBody:b2Body = world.CreateBody(groundBodyDef);<\/p>\n<p>var groundShapeDef:b2PolygonDef = new b2PolygonDef();<br \/>\ngroundShapeDef.SetAsBox(50.0, 10.0);<\/p>\n<p>groundBody.CreateShape(groundShapeDef);<br \/>\n[\/as]<\/p>\n<h3>Creating_a_Dynamic_Body<\/h3>\n<blockquote><p>We can use the same technique to create a dynamic body. The main difference, besides dimensions, is that we must establish the dynamic body&#8217;s mass properties. <\/p><\/blockquote>\n<p><em>source: <a href=\"http:\/\/www.box2d.org\/wiki\/index.php?title=Manual\/AS3#Creating_a_Dynamic_Body\">Creating_a_Dynamic_Body<\/a><\/em><\/p>\n<p>[as]<br \/>\nvar bodyDef:b2BodyDef = new b2BodyDef();<br \/>\nbodyDef.position.Set(0.0, 4.0);<br \/>\nvar body:b2Body = world.CreateBody(bodyDef);<\/p>\n<p>var shapeDef:b2PolygonDef = new b2PolygonDef();<br \/>\nshapeDef.SetAsBox(1.0, 1.0);<br \/>\nshapeDef.density = 1.0;<br \/>\nshapeDef.friction = 0.3;<br \/>\nbody.CreateShape(shapeDef);<br \/>\nbody.SetMassFromShapes();<br \/>\n[\/as]<\/p>\n<h3>Simulating_the_World<\/h3>\n<blockquote><p>So we have initialized the ground box and a dynamic box. Now we are ready to set Newton loose to do his thing. We just have a couple more issues to consider. <\/p><\/blockquote>\n<p><em>source: <a href=\"http:\/\/www.box2d.org\/wiki\/index.php?title=Manual\/AS3#Simulating_the_World_.28of_Box2D.29\">Simulating_the_World<\/a><\/em><br \/>\n[as]<br \/>\nvar timeStep:Number \t= 1.0 \/ 60.0;<br \/>\nvar iterations:Number \t= 10;<\/p>\n<p>for (var i:Number = 0; i < 60; ++i) {\n\tworld.Step(timeStep, iterations);\n\tvar position:b2Vec2 = body.GetPosition();\n\tvar angle:Number = body.GetAngle();\n\ttrace(position.x +','+ position.y +','+ angle);\n}\n[\/as]\n\n\n\n\n<h3>End result<\/h3>\n<p>The document class (<code>HelloWorld.as<\/code>) will look like this:<\/p>\n<div class=\"update\">I didn&#8217;t wrote the code for this tutorial, so this is collection of code copy\/paste from the original <a href=\"http:\/\/www.box2d.org\/wiki\/index.php?title=Manual\/AS3#Hello_Box2D\">AS3: Hello Box2D<\/a> tutorial. But I did, as many probably did, the original tutorial and I was a little disappointed at the end result&#8230; so my addition to the original tutorial can be read in the next part of this series (<a href=\"http:\/\/www.matthijskamstra.nl\/blog\/index.php\/2009\/01\/12\/hello-box2d-part-2\/\"><strong>Hello box2d &#8211; part 2<\/strong><\/a>) <\/div>\n<p>[as]<br \/>\npackage {<\/p>\n<p>\timport flash.display.Sprite;<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>\tpublic class HelloWorld2 extends Sprite {<\/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\tvar world:b2World = 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\tvar body:b2Body = 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#Simulating_the_World_.28of_Box2D.29<br \/>\n\t\t\t\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/<br \/>\n\t\t\tvar timeStep:Number \t= 1.0 \/ 60.0;<br \/>\n\t\t\tvar iterations:Number \t= 10;<\/p>\n<p>\t\t\tfor (var i:Number = 0; i < 60; ++i) {\n\t\t\t\tworld.Step(timeStep, iterations);\n\t\t\t\tvar position:b2Vec2 = body.GetPosition();\n\t\t\t\tvar angle:Number = body.GetAngle();\n\t\t\t\ttrace(position.x +','+ position.y +','+ angle);\n\t\t\t}\n\t\t}\n\t\t\n\t} \/\/ end class\n\n} \/\/ end package\n[\/as]\n\nSo all you need to do is CTRL+ENTER.\n\nNice effect isn't it? No? Only some numbers in the output panel?\nYeah I know that was not very useful...\n\nSo next post will be a better\/improved version of the <strong>Hello world box2D style<\/strong> >> read <a href=\"http:\/\/www.matthijskamstra.nl\/blog\/index.php\/2009\/01\/12\/hello-box2d-part-2\/\"><strong>Hello box2d &#8211; part 2<\/strong><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In programming the Hello world is probably the first you will ever make in a new language. In the box2D wiki you can find a &#8220;Hello world&#8221; in box2DFlash style: AS3: Hello Box2D. Easy as it should be &#8230; or is it? This is not the &#8220;Hello world&#8221; I expected, so I&#8217;ll post one that [&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-749","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 programming the Hello world is probably the first you will ever make in a new language. In the box2D wiki you can find a &quot;Hello world&quot; in box2DFlash style: AS3: Hello Box2D. Easy as it should be ... or is it? This is not the &quot;Hello world&quot; I expected, so I&#039;ll post one that\" \/>\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\/11\/hello-box2d-part-1\/\" \/>\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 1 | [mck]\" \/>\n\t\t<meta property=\"og:description\" content=\"In programming the Hello world is probably the first you will ever make in a new language. In the box2D wiki you can find a &quot;Hello world&quot; in box2DFlash style: AS3: Hello Box2D. Easy as it should be ... or is it? This is not the &quot;Hello world&quot; I expected, so I&#039;ll post one that\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/www.matthijskamstra.nl\/blog\/2009\/01\/11\/hello-box2d-part-1\/\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2009-01-11T01:26:33+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2009-02-14T13:40:43+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 1 | [mck]\" \/>\n\t\t<meta name=\"twitter:description\" content=\"In programming the Hello world is probably the first you will ever make in a new language. In the box2D wiki you can find a &quot;Hello world&quot; in box2DFlash style: AS3: Hello Box2D. Easy as it should be ... or is it? This is not the &quot;Hello world&quot; I expected, so I&#039;ll post one that\" \/>\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\\\/11\\\/hello-box2d-part-1\\\/#article\",\"name\":\"Hello box2D \\u2013 part 1 | [mck]\",\"headline\":\"Hello box2D &#8211; part 1\",\"author\":{\"@id\":\"https:\\\/\\\/www.matthijskamstra.nl\\\/blog\\\/author\\\/admin\\\/#author\"},\"publisher\":{\"@id\":\"https:\\\/\\\/www.matthijskamstra.nl\\\/blog\\\/#organization\"},\"datePublished\":\"2009-01-11T02:26:33+01:00\",\"dateModified\":\"2009-02-14T14:40:43+01:00\",\"inLanguage\":\"en-US\",\"commentCount\":6,\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.matthijskamstra.nl\\\/blog\\\/2009\\\/01\\\/11\\\/hello-box2d-part-1\\\/#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.matthijskamstra.nl\\\/blog\\\/2009\\\/01\\\/11\\\/hello-box2d-part-1\\\/#webpage\"},\"articleSection\":\"AS3, Flash, AS3, box2d, box2dFlash, Flash, flashdevelop\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.matthijskamstra.nl\\\/blog\\\/2009\\\/01\\\/11\\\/hello-box2d-part-1\\\/#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\\\/11\\\/hello-box2d-part-1\\\/#listItem\",\"name\":\"Hello box2D &#8211; part 1\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.matthijskamstra.nl\\\/blog\\\/category\\\/flash\\\/#listItem\",\"name\":\"Flash\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.matthijskamstra.nl\\\/blog\\\/2009\\\/01\\\/11\\\/hello-box2d-part-1\\\/#listItem\",\"position\":4,\"name\":\"Hello box2D &#8211; part 1\",\"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\\\/11\\\/hello-box2d-part-1\\\/#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\\\/11\\\/hello-box2d-part-1\\\/#webpage\",\"url\":\"https:\\\/\\\/www.matthijskamstra.nl\\\/blog\\\/2009\\\/01\\\/11\\\/hello-box2d-part-1\\\/\",\"name\":\"Hello box2D \\u2013 part 1 | [mck]\",\"description\":\"In programming the Hello world is probably the first you will ever make in a new language. In the box2D wiki you can find a \\\"Hello world\\\" in box2DFlash style: AS3: Hello Box2D. Easy as it should be ... or is it? This is not the \\\"Hello world\\\" I expected, so I'll post one that\",\"inLanguage\":\"en-US\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.matthijskamstra.nl\\\/blog\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.matthijskamstra.nl\\\/blog\\\/2009\\\/01\\\/11\\\/hello-box2d-part-1\\\/#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/www.matthijskamstra.nl\\\/blog\\\/author\\\/admin\\\/#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/www.matthijskamstra.nl\\\/blog\\\/author\\\/admin\\\/#author\"},\"datePublished\":\"2009-01-11T02:26:33+01:00\",\"dateModified\":\"2009-02-14T14:40:43+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 1 | [mck]","description":"In programming the Hello world is probably the first you will ever make in a new language. In the box2D wiki you can find a \"Hello world\" in box2DFlash style: AS3: Hello Box2D. Easy as it should be ... or is it? This is not the \"Hello world\" I expected, so I'll post one that","canonical_url":"https:\/\/www.matthijskamstra.nl\/blog\/2009\/01\/11\/hello-box2d-part-1\/","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.matthijskamstra.nl\/blog\/2009\/01\/11\/hello-box2d-part-1\/#article","name":"Hello box2D \u2013 part 1 | [mck]","headline":"Hello box2D &#8211; part 1","author":{"@id":"https:\/\/www.matthijskamstra.nl\/blog\/author\/admin\/#author"},"publisher":{"@id":"https:\/\/www.matthijskamstra.nl\/blog\/#organization"},"datePublished":"2009-01-11T02:26:33+01:00","dateModified":"2009-02-14T14:40:43+01:00","inLanguage":"en-US","commentCount":6,"mainEntityOfPage":{"@id":"https:\/\/www.matthijskamstra.nl\/blog\/2009\/01\/11\/hello-box2d-part-1\/#webpage"},"isPartOf":{"@id":"https:\/\/www.matthijskamstra.nl\/blog\/2009\/01\/11\/hello-box2d-part-1\/#webpage"},"articleSection":"AS3, Flash, AS3, box2d, box2dFlash, Flash, flashdevelop"},{"@type":"BreadcrumbList","@id":"https:\/\/www.matthijskamstra.nl\/blog\/2009\/01\/11\/hello-box2d-part-1\/#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\/11\/hello-box2d-part-1\/#listItem","name":"Hello box2D &#8211; part 1"},"previousItem":{"@type":"ListItem","@id":"https:\/\/www.matthijskamstra.nl\/blog\/category\/flash\/#listItem","name":"Flash"}},{"@type":"ListItem","@id":"https:\/\/www.matthijskamstra.nl\/blog\/2009\/01\/11\/hello-box2d-part-1\/#listItem","position":4,"name":"Hello box2D &#8211; part 1","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\/11\/hello-box2d-part-1\/#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\/11\/hello-box2d-part-1\/#webpage","url":"https:\/\/www.matthijskamstra.nl\/blog\/2009\/01\/11\/hello-box2d-part-1\/","name":"Hello box2D \u2013 part 1 | [mck]","description":"In programming the Hello world is probably the first you will ever make in a new language. In the box2D wiki you can find a \"Hello world\" in box2DFlash style: AS3: Hello Box2D. Easy as it should be ... or is it? This is not the \"Hello world\" I expected, so I'll post one that","inLanguage":"en-US","isPartOf":{"@id":"https:\/\/www.matthijskamstra.nl\/blog\/#website"},"breadcrumb":{"@id":"https:\/\/www.matthijskamstra.nl\/blog\/2009\/01\/11\/hello-box2d-part-1\/#breadcrumblist"},"author":{"@id":"https:\/\/www.matthijskamstra.nl\/blog\/author\/admin\/#author"},"creator":{"@id":"https:\/\/www.matthijskamstra.nl\/blog\/author\/admin\/#author"},"datePublished":"2009-01-11T02:26:33+01:00","dateModified":"2009-02-14T14:40:43+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 1 | [mck]","og:description":"In programming the Hello world is probably the first you will ever make in a new language. In the box2D wiki you can find a &quot;Hello world&quot; in box2DFlash style: AS3: Hello Box2D. Easy as it should be ... or is it? This is not the &quot;Hello world&quot; I expected, so I'll post one that","og:url":"https:\/\/www.matthijskamstra.nl\/blog\/2009\/01\/11\/hello-box2d-part-1\/","article:published_time":"2009-01-11T01:26:33+00:00","article:modified_time":"2009-02-14T13:40:43+00:00","twitter:card":"summary_large_image","twitter:title":"Hello box2D \u2013 part 1 | [mck]","twitter:description":"In programming the Hello world is probably the first you will ever make in a new language. In the box2D wiki you can find a &quot;Hello world&quot; in box2DFlash style: AS3: Hello Box2D. Easy as it should be ... or is it? This is not the &quot;Hello world&quot; I expected, so I'll post one that"},"aioseo_meta_data":{"post_id":"749","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 1\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 1","link":"https:\/\/www.matthijskamstra.nl\/blog\/2009\/01\/11\/hello-box2d-part-1\/"}],"_links":{"self":[{"href":"https:\/\/www.matthijskamstra.nl\/blog\/wp-json\/wp\/v2\/posts\/749","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=749"}],"version-history":[{"count":10,"href":"https:\/\/www.matthijskamstra.nl\/blog\/wp-json\/wp\/v2\/posts\/749\/revisions"}],"predecessor-version":[{"id":764,"href":"https:\/\/www.matthijskamstra.nl\/blog\/wp-json\/wp\/v2\/posts\/749\/revisions\/764"}],"wp:attachment":[{"href":"https:\/\/www.matthijskamstra.nl\/blog\/wp-json\/wp\/v2\/media?parent=749"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.matthijskamstra.nl\/blog\/wp-json\/wp\/v2\/categories?post=749"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.matthijskamstra.nl\/blog\/wp-json\/wp\/v2\/tags?post=749"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}