Assassination Classroom, back in love with the web!

Hey guys, it has been a long time since I didn’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 the most cross platform tool which exist, that’s right. However as a developer, I thought it wouldn’t improve my skills like Objective-C or even Unity using C-Sharp did. And that’s always true! JS isn’t a smart language, and it isn’t very interesting to deal with it (no interface…).

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’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.
Also on a technology part Canvas performances are improved “each month”, and WebGL support climbs. JavaScript is still a piece of shit but we have many meta languages (Haxe, TypeScript, Dart, CoffeeScript) doing a great job. On an other part I heard about pixi.js some months ago, a WebGL rendering engine with a Canvas fallback and I wanted to give it a try.

The game
Assassination-ClasroomAssassination Classroom is a Japanese manga. The book is now available in France and Kana would like to make some marketing with a game. So we’ve created a Whac-A-Mole.

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.

There is a Facebook connect to elect the best player of the week and give him a plush.

TypeScript
Why did I chose TypeScript instead of Haxe with which I’m familiar? Well it seems that TypeScript has the wind in its sails. It’s becoming very popular and as an AS3 developer it’s very easy to use! IntelliJ Idea supports it very well, that was perfect.

pixi.js
I’m still waiting Starling JS, being familiar with Sparrow and Starling would have made the transition easily. However it isn’t available yet, so I give a try to pixi.js and really enjoyed it! It’s very powerful and there is a little community. However the lack of support (we need a good tutorial for getting started with mobile target!!) is regrettable if we’ve short deadline. I know that Mat is very busy and is doing his best. Any doubt that it will be improved.
There 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!!
Note I’ve made TypeScript definitions for pixi.js available here.

Now it’s time to have some feedbacks concerning HTML5 mobile development:

Viewport & retina
Well it’s very hard to deal with both. I’m not sure at all how to make them running fine. This is how I grab the retina display:

static GetStageWidth():number {
       return $(window).width() * ((<any>window).devicePixelRatio || Math.round(window.screen.availWidth / document.documentElement.clientWidth));
}

I had strong issues enabling retina, my performances were awful. So I turned off the devicePixelRatio and let the viewport to content=”width=device-width”. Now performances are ok.

Audio
I used buzz library which works fine! However on Android (on my Nexus 7, last system version), a sound can’t loop. I tried also without this lib, no way… It isn’t possible to loop a sound on Android (Chrome)!?

iOS7
It comes with its bugs on Safari. I’m not able to remove the icons at the bottom even if I’ve scrolled… very annoying.

Tools
A new “platform” means a new toolset to have! I really enjoyed working with:
Intellij Idea as my main code editor (code compile automatically, that’s great).
LiveReload for refreshing automatically the browser (you can also do that via IntelliJ).
Adobe Edge Inspect to refresh on all your devices!
Code Orchestra Livecoding Tool, the project was more or less completed when COLT out its JS version. I won’t miss to use it for my next web project!

Yep, I’m back in love with the web. Everything isn’t perfect but good tools are coming and I enjoy its freedom. Does a Citrus JS is planned? Not at the moment, but if I’ve several HTML5 game projects, without any doubt!

4 thoughts on “Assassination Classroom, back in love with the web!

  1. At the last few days i was thinking about TypeScript and citrus , why we don’t working on? so after that i think that you are very excited to start this ! But it needs a great work in Typescript we miss starling , a power of awayd3d but the good news there is a new TypeScript version of away3d , it still at the begining but the friends of rob batman working hard .

  2. code compile automatically, that’s great – I like this feature too.
    There are so many frameworks for JS nowadays, I think even Flash coun’t dreamed about it.

Leave a Reply

Your email address will not be published. Required fields are marked *