{"id":971,"date":"2013-10-16T08:29:08","date_gmt":"2013-10-16T07:29:08","guid":{"rendered":"http:\/\/www.aymericlamboley.fr\/blog\/?p=971"},"modified":"2014-11-01T14:34:42","modified_gmt":"2014-11-01T13:34:42","slug":"assassination-classroom-back-in-love-with-the-web","status":"publish","type":"post","link":"http:\/\/www.aymericlamboley.fr\/blog\/assassination-classroom-back-in-love-with-the-web\/","title":{"rendered":"Assassination Classroom, back in love with the web!"},"content":{"rendered":"<p>Hey guys, it has been a long time since I didn&#8217;t make a project for the web. Some <a href=\"http:\/\/www.aymericlamboley.fr\/blog\/my-thoughts-on-flash-and-its-recent-events\/\" target=\"_blank\">years ago<\/a>, I decided to go away from my web training and learnt native languages (Objective-C) and focus on cross platform tools (Flash\/AIR, Unity and Haxe NME which is become OpenFL). You will say that HTML5\/JS is the most cross platform tool which exist, that&#8217;s right. However as a developer, I thought it wouldn&#8217;t improve my skills like Objective-C or even Unity using C-Sharp did. And that&#8217;s always true! JS isn&#8217;t a smart language, and it isn&#8217;t very interesting to deal with it (no interface&#8230;).<\/p>\n<p>However some weeks ago, someone offered me a game project using HTML5 technology, and I said yes! Why the hell, I said yes? Because web has evolved. It is far to be perfect right now, but I think the road is the good one. It&#8217;s amazing to be able to play your game in any browser on your computer and your smartphone! No apps to download, just go to an URL.<br \/>\nAlso on a technology part Canvas performances are improved &#8220;each month&#8221;, and WebGL support climbs. JavaScript is still a piece of shit but we have many meta languages (<a href=\"http:\/\/haxe.org\/\" target=\"_blank\">Haxe<\/a>, <a href=\"http:\/\/typescriptlang.org\/\" target=\"_blank\">TypeScript<\/a>, <a href=\"http:\/\/www.dartlang.org\/\" target=\"_blank\">Dart<\/a>, <a href=\"http:\/\/coffeescript.org\/\" target=\"_blank\">CoffeeScript<\/a>) doing a great job. On an other part I heard about <a href=\"http:\/\/pixijs.com\/\" target=\"_blank\">pixi.js<\/a> some months ago, a WebGL rendering engine with a Canvas fallback and I wanted to give it a try.<\/p>\n<p><!--more--><\/p>\n<p><strong><a href=\"http:\/\/www.kana.fr\/jeux\/assassination-classroom\/\" target=\"_blank\">The game<\/a><\/strong><br \/>\n<a href=\"http:\/\/www.aymericlamboley.fr\/blog\/wp-content\/uploads\/2013\/10\/Assassination-Clasroom.png\"><img decoding=\"async\" loading=\"lazy\" src=\"http:\/\/www.aymericlamboley.fr\/blog\/wp-content\/uploads\/2013\/10\/Assassination-Clasroom-300x187.png\" alt=\"Assassination-Clasroom\" width=\"300\" height=\"187\" class=\"alignleft size-medium wp-image-973\" srcset=\"http:\/\/www.aymericlamboley.fr\/blog\/wp-content\/uploads\/2013\/10\/Assassination-Clasroom-300x187.png 300w, http:\/\/www.aymericlamboley.fr\/blog\/wp-content\/uploads\/2013\/10\/Assassination-Clasroom-1024x640.png 1024w, http:\/\/www.aymericlamboley.fr\/blog\/wp-content\/uploads\/2013\/10\/Assassination-Clasroom.png 1526w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><a href=\"http:\/\/en.wikipedia.org\/wiki\/Assassination_Classroom\" target=\"_blank\">Assassination Classroom<\/a> is a Japanese manga. The book is now available in France and <a href=\"http:\/\/www.kana.fr\/\" target=\"_blank\">Kana<\/a> would like to make some marketing with a game. So we&#8217;ve created a <a href=\"http:\/\/en.wikipedia.org\/wiki\/Whac-A-Mole\" target=\"_blank\">Whac-A-Mole<\/a>.<\/p>\n<p>The game runs fine in any desktop browser and is playable on mobile browser too. Note that we had a first version focused on mobile for the press. This public game is designed for desktop but should run more or less correctly on mobile.<\/p>\n<p>There is a Facebook connect to elect the best player of the week and give him a plush.<\/p>\n<p><strong>TypeScript<\/strong><br \/>\nWhy did I chose <a href=\"http:\/\/typescriptlang.org\/\" target=\"_blank\">TypeScript<\/a> instead of Haxe with which I&#8217;m familiar? Well it seems that TypeScript has the wind in its sails. It&#8217;s becoming very popular and as an AS3 developer it&#8217;s very easy to use! <a href=\"http:\/\/www.jetbrains.com\/idea\/\" target=\"_blank\">IntelliJ Idea<\/a> supports it very well, that was perfect.<\/p>\n<p><strong>pixi.js<\/strong><br \/>\nI&#8217;m still waiting <a href=\"http:\/\/gamua.com\/area-51\/\" target=\"_blank\">Starling JS<\/a>, being familiar with Sparrow and Starling would have made the transition easily. However it isn&#8217;t available yet, so I give a try to <a href=\"http:\/\/pixijs.com\/\" target=\"_blank\">pixi.js<\/a> and really enjoyed it! It&#8217;s very powerful and there is a little <a href=\"http:\/\/www.html5gamedevs.com\/forum\/15-pixijs\/\" target=\"_blank\">community<\/a>. However the lack of support (we need a good tutorial for getting started with mobile target!!) is regrettable if we&#8217;ve short deadline. I know that Mat is very busy and is doing his best. Any doubt that it will be improved.<br \/>\nThere are some missing features: trim\/crop support for sprite sheets, some methods that we have with Flash concerning the display list etc. Nothing too hard to deal with. So kudos guys!!<br \/>\nNote I&#8217;ve made TypeScript definitions for pixi.js available <a href=\"https:\/\/github.com\/alamboley\/pixi.js\" target=\"_blank\">here<\/a>.<\/p>\n<p>Now it&#8217;s time to have some feedbacks concerning HTML5 mobile development:<\/p>\n<p><strong>Viewport &#038; retina<\/strong><br \/>\nWell it&#8217;s very hard to deal with both. I&#8217;m not sure at all how to make them running fine. This is how I grab the retina display:<\/p>\n<pre lang=\"javascript\">static GetStageWidth():number {\r\n       return $(window).width() * ((<any>window).devicePixelRatio || Math.round(window.screen.availWidth \/ document.documentElement.clientWidth));\r\n}<\/pre>\n<p>I had strong issues enabling retina, my performances were awful. So I turned off the devicePixelRatio and let the viewport to content=&#8221;width=device-width&#8221;. Now performances are ok.<\/p>\n<p><strong>Audio<\/strong><br \/>\nI used <a href=\"http:\/\/buzz.jaysalvat.com\/\" target=\"_blank\">buzz<\/a> library which works fine! However on Android (on my Nexus 7, last system version), a sound can&#8217;t loop. I tried also without this lib, no way&#8230; It isn&#8217;t possible to loop a sound on Android (Chrome)!?<\/p>\n<p><strong>iOS7<\/strong><br \/>\nIt comes with its <a href=\"http:\/\/www.mobilexweb.com\/blog\/safari-ios7-html5-problems-apis-review\" target=\"_blank\">bugs<\/a> on Safari. I&#8217;m not able to remove the icons at the bottom even if I&#8217;ve scrolled&#8230; very annoying.<\/p>\n<p><strong>Tools<\/strong><br \/>\nA new &#8220;platform&#8221; means a new toolset to have! I really enjoyed working with:<br \/>\n&#8211; <a href=\"http:\/\/www.jetbrains.com\/idea\/\" target=\"_blank\">Intellij Idea<\/a> as my main code editor (code compile automatically, that&#8217;s great).<br \/>\n&#8211; <a href=\"http:\/\/livereload.com\/\" target=\"_blank\">LiveReload<\/a> for refreshing automatically the browser (you can also do that via IntelliJ).<br \/>\n&#8211; <a href=\"http:\/\/html.adobe.com\/edge\/inspect\/\" target=\"_blank\">Adobe Edge Inspect<\/a> to refresh on all your devices!<br \/>\n&#8211; <a href=\"http:\/\/codeorchestra.com\/\" target=\"_blank\">Code Orchestra Livecoding Tool<\/a>, the project was more or less completed when COLT out its JS version. I won&#8217;t miss to use it for my next web project!<\/p>\n<p>Yep, I&#8217;m back in love with the web. Everything isn&#8217;t perfect but good tools are coming and I enjoy its freedom. Does a <a href=\"http:\/\/citrusengine.com\/\" target=\"_blank\">Citrus<\/a> JS is planned? Not at the moment, but if I&#8217;ve several HTML5 game projects, without any doubt!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hey guys, it has been a long time since I didn&#8217;t make a project for the web. Some years ago, I decided to go away from my web training and learnt native languages (Objective-C) and focus on cross platform tools (Flash\/AIR, Unity and Haxe NME which is become OpenFL). You will say that HTML5\/JS is &hellip; <a href=\"http:\/\/www.aymericlamboley.fr\/blog\/assassination-classroom-back-in-love-with-the-web\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Assassination Classroom, back in love with the web!<\/span> <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":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0},"categories":[167,84,168],"tags":[169,87,193],"_links":{"self":[{"href":"http:\/\/www.aymericlamboley.fr\/blog\/wp-json\/wp\/v2\/posts\/971"}],"collection":[{"href":"http:\/\/www.aymericlamboley.fr\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.aymericlamboley.fr\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.aymericlamboley.fr\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.aymericlamboley.fr\/blog\/wp-json\/wp\/v2\/comments?post=971"}],"version-history":[{"count":15,"href":"http:\/\/www.aymericlamboley.fr\/blog\/wp-json\/wp\/v2\/posts\/971\/revisions"}],"predecessor-version":[{"id":1251,"href":"http:\/\/www.aymericlamboley.fr\/blog\/wp-json\/wp\/v2\/posts\/971\/revisions\/1251"}],"wp:attachment":[{"href":"http:\/\/www.aymericlamboley.fr\/blog\/wp-json\/wp\/v2\/media?parent=971"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.aymericlamboley.fr\/blog\/wp-json\/wp\/v2\/categories?post=971"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.aymericlamboley.fr\/blog\/wp-json\/wp\/v2\/tags?post=971"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}