EaselJS: The Flash-developer-friendly HTML5 canvas library behind http://worldsbiggestpacman.com

14 Apr

 

http://WorldsBiggestPacMan.com is rather ace isn’t it?

Fortunately for intrepid pattern miners, this is the last remaining page on the web EVAH to use uncompressed code, which means we can dig into the app. Not that I have, but you can see some libraries being used here: http://worldsbiggestpacman.com/js/game/include.js. Among them, EaselJS (http://easeljs.com/), which I just had a quick squizz at.

Easel is a Flash-like library for HTML5 canvas, which is a good thing to exist as Flash developers still know more than most traditional web developers about graphics and gaming. According to this tutorial (http://www.mikechambers.com/blog/2011/01/19/getting-started-with-the-canvas-element-and-easeljs/), the code looks more like canvas than you might actually expect. The main difference is you can get objects to represent the concepts in your canvas display.

A re-annotation+refactoring of some of the code in said article:

Notice it also supports chaining (.setStrokeStyle().drawCircle()), a must-have for any library working with a close representation of the Canvas. Chaining alone is a reason why application code has no business using raw Canvas, any more than it has any business using raw XHR. Get a library or roll your own!

So that was a cursory glance at Easel among other miscellany.
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: