
{"id":2109,"date":"2015-02-05T20:37:26","date_gmt":"2015-02-05T19:37:26","guid":{"rendered":"http:\/\/www.matthijskamstra.nl\/blog\/?p=2109"},"modified":"2015-02-21T23:22:02","modified_gmt":"2015-02-21T22:22:02","slug":"tween-engine-go-part-2","status":"publish","type":"post","link":"https:\/\/www.matthijskamstra.nl\/blog\/2015\/02\/05\/tween-engine-go-part-2\/","title":{"rendered":"Tween engine Go &#8211; part 2"},"content":{"rendered":"<p>My <a href=\"http:\/\/www.matthijskamstra.nl\/blog\/?p=2100\" title=\"Tween engine Go\">last post<\/a> was about my new WIP tween library Go.<\/p>\n<p>I have been updating my little experiment and it&#8217;s getting better.<br \/>\nLooking into other libraries codes is very educational.<\/p>\n<p>Does it perform as good as the default Haxe tween engine <a href=\"https:\/\/github.com\/openfl\/actuate\" title=\"Actuate\" target=\"_blank\">Actuate<\/a>?<br \/>\nYeah that would have been great, but nope&#8230; around 1300 object, Go will start dropping frame-rate in Flash.<\/p>\n<p>My goal was to create a <strong>lightweight, simple, compact, chainable tween library for haxe\/openfl<\/strong>.<\/p>\n<p>Could I perform as good as Actuate?<br \/>\nI am not sure, Actuate is very well written and Joshua Granick has been working on it for a long time and tested it extensively.<br \/>\nBut I probably could improve on my code and get a better performance in Flash (in which I did the <a href=\"http:\/\/matthijskamstra.github.io\/go\/#stress\" target=\"_blank\">stress-test<\/a>). The downside is that my code will be full of <a href=\"http:\/\/haxe.org\/manual\/lf-condition-compilation.html\" target=\"_blank\">condition compilation<\/a> and that would mean the code would become more and more complex.<\/p>\n<p>Why am I sure it will improve, well I cheated and did some flash specific code modifications.<br \/>\nCheck the <a href=\"https:\/\/github.com\/MatthijsKamstra\/go\/blob\/master\/lets\/Go.hx#L411\" target=\"_blank\">code in github<\/a><br \/>\nIn my first draft it was just:<\/p>\n<pre class=\"brush: as3; title: ; wrap-lines: true; notranslate\" title=\"\">\r\nvar range = _props.get(n);\r\nReflect.setProperty(_target, n, _easing.ease( time, range.from, (range.to-range.from), _duration ) );\r\n<\/pre>\n<p>and that performed very bad in Flash (if I remember correctly the framerate already dropped after 100 object)<br \/>\nAnd I updated it to this and that works better&#8230; for Flash<\/p>\n<pre class=\"brush: as3; title: ; wrap-lines: true; notranslate\" title=\"\">\r\nvar range = _props.get(n);\r\n#if flash\r\nuntyped _target&#x5B;n] = _easing.ease( time, range.from, (range.to-range.from), _duration ) ;\r\n#else\r\nReflect.setProperty(_target, n, _easing.ease( time, range.from, (range.to-range.from), _duration ) );\r\n#end\r\n<\/pre>\n<p>So the question is more do I want to change the code for specific platforms?<br \/>\nFor now I am not going to focus on Flash to enhance it&#8217;s performance&#8230; there is little chance that I will be animating 1000+ objects.<\/p>\n<p>So I will be using it in my own projects and will run into problems that I will fix.<br \/>\nYou are welcome to use it as well and report bugs or other improvements.<\/p>\n<p>I&#8217;ve update the promotional website: <a href=\"http:\/\/matthijskamstra.github.io\/go\/\" title=\"Go\" target=\"_blank\">check it here<\/a>.<br \/>\nYou can find the stress-test there, where I compare <strong>Go<\/strong> with <strong>Actuate<\/strong>.<br \/>\nIf you want to add your tweening library, add it <a href=\"https:\/\/github.com\/MatthijsKamstra\/go\/tree\/master\/example\/stress_test\/Source\/tweenTests\" target=\"_blank\">here<\/a> in github.<br \/>\nDownload\/install instructions can be found <a href=\"https:\/\/github.com\/MatthijsKamstra\/go\" target=\"_blank\">here<\/a>.<\/p>\n<p>Happy tweening.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>My last post was about my new WIP tween library Go. I have been updating my little experiment and it&#8217;s getting better. Looking into other libraries codes is very educational. Does it perform as good as the default Haxe tween engine Actuate? Yeah that would have been great, but nope&#8230; around 1300 object, Go will [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":2123,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[20,360,6],"tags":[407,412,383,382],"class_list":["post-2109","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-animation","category-haxe","category-open-source-freeware","tag-animation","tag-haxe","tag-openfl","tag-tween"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.matthijskamstra.nl\/blog\/wp-json\/wp\/v2\/posts\/2109","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=2109"}],"version-history":[{"count":2,"href":"https:\/\/www.matthijskamstra.nl\/blog\/wp-json\/wp\/v2\/posts\/2109\/revisions"}],"predecessor-version":[{"id":2111,"href":"https:\/\/www.matthijskamstra.nl\/blog\/wp-json\/wp\/v2\/posts\/2109\/revisions\/2111"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.matthijskamstra.nl\/blog\/wp-json\/wp\/v2\/media\/2123"}],"wp:attachment":[{"href":"https:\/\/www.matthijskamstra.nl\/blog\/wp-json\/wp\/v2\/media?parent=2109"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.matthijskamstra.nl\/blog\/wp-json\/wp\/v2\/categories?post=2109"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.matthijskamstra.nl\/blog\/wp-json\/wp\/v2\/tags?post=2109"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}