{"id":1250,"date":"2013-09-20T10:29:06","date_gmt":"2013-09-20T14:29:06","guid":{"rendered":"http:\/\/www.rocketshipgames.com\/blogs\/tjkopena\/?p=1250"},"modified":"2013-09-20T10:29:06","modified_gmt":"2013-09-20T14:29:06","slug":"rockethaxe-2-0-tile-physics","status":"publish","type":"post","link":"https:\/\/www.rocketshipgames.com\/blogs\/tjkopena\/2013\/09\/rockethaxe-2-0-tile-physics\/","title":{"rendered":"RocketHaxe 2.0: Tile Physics"},"content":{"rendered":"<p>Fresh new demo:<\/p>\n<p><center><object id=\"WaterfallDemo\" width=\"480\" height=\"480\" classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http:\/\/download.macromedia.com\/pub\/shockwave\/cabs\/flash\/swflash.cab#version=6,0,40,0\"><param name=\"src\" value=\"\/tools\/rockethaxe\/scratch\/20130920-Waterfall.swf\" \/><embed id=\"WaterfallDemo\" width=\"480\" height=\"480\" type=\"application\/x-shockwave-flash\" src=\"\/tools\/rockethaxe\/scratch\/20130920-Waterfall.swf\" \/><!--[if !IE]>--> <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.rocketshipgames.com\/blogs\/tjkopena\/wp-includes\/js\/tinymce\/themes\/advanced\/img\/trans.gif\" class=\"mceItemMedia mceItemFlash\" width=\"480\" height=\"480\" data-mce-json=\"{'video':{},'params':{'src':'\/tools\/rockethaxe\/scratch\/20130920-Waterfall.swf'},'name':null,'object_html':' &lt;!--&lt;![endif]--&gt;&lt;div&gt;&lt;h1&gt;Flash Required!&lt;\/h1&gt;&lt;p&gt;&lt;a href=\\&quot;http:\/\/www.adobe.com\/go\/getflashplayer\\&quot;&gt;&lt;img src=\\&quot;http:\/\/www.adobe.com\/images\/shared\/download_buttons\/get_flash_player.gif\\&quot; alt=\\&quot;Get Adobe Flash player\\&quot; \/&gt;&lt;\/a&gt;&lt;\/p&gt;&lt;\/div&gt;&lt;p&gt;&lt;!--[if !IE]&gt;--&gt;&lt;\/p&gt;','hspace':null,'vspace':null,'align':null,'bgcolor':null}\" alt=\"\" \/><!--<![endif]--><\/object><\/center><\/p>\n<p>What&#8217;s new &#038; cool about this one is that the green boxes are actually a tilemap, not objects in the same sense as the red boxes.  This demo doesn&#8217;t use it, but there is some support for autotiling bitmaps, etc., and there&#8217;s a <a href=\"https:\/\/code.google.com\/p\/rockethaxe\/wiki\/TileCatalog\">fair bit  going on with the tile engine<\/a> already.  Bouncing off the screen edges is also using the same physics as the object collisions, whereas in the earlier demos the bounds just manipulated velocities and didn&#8217;t apply friction and position correction.  So, the physics engine is now encompassing several different mechanisms for colliding different kinds of things.  The internal structure of it has also matured quite a bit, the classes decompose pretty nicely now.<\/p>\n<p>Along the way a few bugs have been found, and some improvements made.  The previous demos actually have a bug whereby the collision normal for circles that have completely penetrated inside boxes was not being computed correctly if the boxes weren&#8217;t square, causing them to fly off in the wrong direction.  Impulses are also now being computed &#038; applied multiple times per update, so collisions travel back up stacks and such.  On Linux it&#8217;s actually pretty stable, for the most part a stack needs to get fairly large or an object stuck in a tight space (just within the error tolerances) to see a lot of quiver.  Flash is a lot more unstable and still has a fair bit of quiver, though it&#8217;s generally ok until you have 4+ objects stacked up.  I&#8217;m not sure yet what the relevant difference is between the two platforms.<\/p>\n<p>So, excitingly, &#8220;all&#8221; that&#8217;s left from here is to clean up the tile engine, port over the sprite animations and sound controls from RocketHaxe 1.0, and it&#8217;s all set for some fancy platformer-type games!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Fresh new demo: What&#8217;s new &#038; cool about this one is that the green boxes are actually a tilemap, not objects in the same sense as the red boxes. This demo doesn&#8217;t use it, but there is some support for autotiling bitmaps, etc., and there&#8217;s a fair bit going on with the tile engine already. &hellip; <a href=\"https:\/\/www.rocketshipgames.com\/blogs\/tjkopena\/2013\/09\/rockethaxe-2-0-tile-physics\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[58],"tags":[82,173,277],"class_list":["post-1250","post","type-post","status-publish","format-standard","hentry","category-code","tag-haxe","tag-physics","tag-videogames"],"_links":{"self":[{"href":"https:\/\/www.rocketshipgames.com\/blogs\/tjkopena\/wp-json\/wp\/v2\/posts\/1250","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.rocketshipgames.com\/blogs\/tjkopena\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rocketshipgames.com\/blogs\/tjkopena\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rocketshipgames.com\/blogs\/tjkopena\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rocketshipgames.com\/blogs\/tjkopena\/wp-json\/wp\/v2\/comments?post=1250"}],"version-history":[{"count":2,"href":"https:\/\/www.rocketshipgames.com\/blogs\/tjkopena\/wp-json\/wp\/v2\/posts\/1250\/revisions"}],"predecessor-version":[{"id":1280,"href":"https:\/\/www.rocketshipgames.com\/blogs\/tjkopena\/wp-json\/wp\/v2\/posts\/1250\/revisions\/1280"}],"wp:attachment":[{"href":"https:\/\/www.rocketshipgames.com\/blogs\/tjkopena\/wp-json\/wp\/v2\/media?parent=1250"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rocketshipgames.com\/blogs\/tjkopena\/wp-json\/wp\/v2\/categories?post=1250"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rocketshipgames.com\/blogs\/tjkopena\/wp-json\/wp\/v2\/tags?post=1250"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}