Centre Image : The strange combination of position absolute, margin auto and an image tag

by Developer @ pebbl.co.uk on Thursday, 25 April 2013

Just recently I was charged with the task of upgrading the Slideshow ability on the Tate's website, basically finishing off the work so that it could display more than just images, and to finalise it's mobile support. Most of the work was quite straightforward and entailed reverting some of the previous bespoke modifications made to the default Flexslider plugin, and then enhancing the out-of-the-box functionality with things like full-screen mode, and managing audio or video files that might be contained within.

Stop it and tidy up

One of the main improvements I made was to try and get things working with as little JavaScript as possible, this meant refactoring the CSS somewhat, and due to not having worked closely with CSS for the last year — save for the odd stackoverflow answer — I was quickly reminded just how frustrating-a-language CSS is to debug and repair... especially in it's pure form, outside of any compilation framework like LESS.

Anyway, re-realisations aside, I got pretty much everything working via CSS save for two issues. The first of these problems was the age old annoyance of how to centre an element in the middle of a container on both the vertical and the horizontal. Now I've been using CSS since the early days — if you could refer to them as early — so I'm quite aware of the different vertical alignment tricks that can be employed. I was also aware that the only way(s) I knew of to get an element of unknown or variable dimensions to centre was either to use a table, display:table, or use a background-image instead (at least for images anyway). Any one of these would have taken some crowbarring to get working harmoniously with the slideshow system. Unfortunately, every one of my slideshow images had variable dimensions, which not only varied depending on itself, but was also responsive to the display size... so I had to find some nicer way of doing it.

Solution?

Considering the fact that the well known browsers are now developing at a rate of knots, I decided that there must be a better way by now. Obviously I could have used flexbox, but it's fluctuating and unreliable support would have meant more headaches in testing than I had time for. So I spent quite a bit of time searching around, finding pretty much all the ways I already knew about, until I stumbled upon this random suggestion:

img { position:absolute; left:0;top:0;right:0;bottom:0; margin:auto; }

At first glance that snippet made no sense to me, and I almost automatically dismissed it as nonsense. I'm quite glad I ignored my first thoughts however and tested it out, because — at least for every user agent I checked — it did exactly what I needed. Now, if anyone can explain why this has been built in, and why images should behave differently to any other element, I'd be interested to hear... until then I'll just mark it down to another strange oddity in the interpretation of the rather wholly strange language/construct that is CSS.

Internet Explorer Detection : The power of conditional comments but via jQuery

by Developer @ pebbl.co.uk on Wednesday, 24 April 2013

I came across a situation the other day where I needed a specific browser check (IE7 or less), there wasn't a particular testable feature to hand that would do and I didn't have access to the markup. My usual fix for Internet Explorer specific bugs is to use conditional comments, they do exactly what it says on the tin, however.. not having access to the page markup thwarted this otherwise quick and easy solution.

Rather than falling back to tenuous agent string checking — particularly worrying when it comes to specific version number checks — or bashing my head against multiple feature tests that could be invalidated in the future, I thought the following implementation would be no less mad, and maybe even slightly useful:

var isOldIE = function(query){
  return $('<!--['+(query||'if lte IE 7')+']>OLDIE<![endif]-->')
    .text() === 'OLDIE'
  ;
}

Make of it what you will, but I rather like it... even though it is hideous from an optimisation point of view.

describe.js - v0.4 (ish)

by Developer @ pebbl.co.uk on Sunday, 17 February 2013

After having a bit of time off to wander around Thailand, and finding that — despite having lovely people, beaches, street food, temples and sea life — that the country is drowning in vehicles and unwalkable roads.. this meant there were a few days of relaxing near my laptop. So I took the time to code in the sun and do some extra work with describe.js. In doing so I notice a few problems, which I've now tried to rectify.

  1. Collections only worked for constructors with one method, the foolish mistake of relying on a variable referenced from within a loop.
  2. The 'private' tag was working based on the constructor, so each instance of a constructor was sharing the same private object. Doh!
  3. The 'private' methods were attached (as wanted) to the ._ object, however this meant that 'this' inside a private method refered to the _ object, rather than the constructed instance.

So, I have now repaired these issues, which should definitely speed up development in my other projects. At the same time I've also added a few extra abilities:

  1. Getters and Setters — two new tags exists by default, get and set. These utilise the __defineGetter__ and __defineSetter__ methods, if the browser supports them. The upshot of this is that you can now create getter and setter attributes, that also support type overloading.
  2. Improved support for merging or wrapping functions — This was a byproduct of the fixes. There are now the following methods: merge, unmerge, wrap and unwrap.
  3. Rewrote the tag/plugin handling — this was mainly to fix the private issues above, but now gives the coder a choice to implement a tag/plugin method on the constructor or on the instance (the choice is made by creating a tag function of either 3 or 4 arguments). Implemented on the constructor the prototype object is used (saving resources), implemented on the instance (all private methods use this) the methods are specifically applied to the instance's private object.
  4. I've worked out many of the bugs with regards to properties (before describe only concerned itself with methods). So, now it is possible to create constructors with simple base type attributes... rather silly not to be able to support this in the first place.

Before I go...

I say 0.4ish because there is one major issue that I still hope to fix before uploading the new version, this is the good old multiple inheritance system. This will be the fourth rewrite of this particular bit of code, it's complicated, but I hope to simplify things and stop trying to be so clever (mainly because clever always causes issues unless you've managed to discover perfection lying around somewhere).

I think I'm going to go the same way as a number of other libraries and just use a shallow copy system for the inheritance, rather than relying on a dynamically morphing prototype chain. The reason for this is that I seem to be using the prototype chain more and more with my work in other projects, and the current system is getting in the way. I generally don't need the power of inheritance anyway, just the power of mixins, which is what a shallow copy system would provide.

I guess what I'm saying is there will be an update shortly... so watch the skies, or something.

Oh, a few more other improvements that are in the pipe line:

  1. Collections don't support Getters and Setters, but they will do.
  2. Also, I need to work out a way of describing tag behaviour when using multiple tags. For example, currently specifying 'private get methodName' or 'private set methodName' does not create a private getter or setter. Instead it creates a private method called methodName and a public getter/setter called methodName too.

HMRC — tales of the expected.

by Developer @ pebbl.co.uk on Wednesday, 16 January 2013

Ok, so the title is rather the opposite of self-explanatory, put simply this post is just a complaint really, it has no technical content—I'm still just baffled as to why I expected anything different...

Just recently, due to hitting the VAT threshold as a self-employed web something or other, I had to—yet again—open communications with the creaking bureaucracy that is the HMRC.

When is a website not a website?

My first port of call was obviously their website, which, to anyone—well at least anyone who has the slightest semblance of what good design, good content and good navigation should be—is always a disappointing, if not aggravating experience. Especially if you know how much money it cost to build.

Do not try and find anything specific on hmrc.gov.uk, you'll waste more than just time. I was hunting around for information with regard to already being set up in business, but needing to become VAT registered (probably one of the most common requests). I just ended up following link after link, trying to piece together the little bits of useful snippets dispersed amongst the backdrop of much repetition and information about rare scenarios.

Within at least the first few seconds of landing on the "Introduction to VAT" page and navigating around you'll be hit with hundreds of blocks of bullet points and more "if statements" than a popular JavaScript library would contain. After reading through and working out what seemed to be where I needed to go, I just ended up with dead-end paths... an example of this is the option to register for VAT Online. Sounds great, until you get to the "What you'll need" section, where it states you need a VAT Number! (so not what you actually think it is then). Even if you try and actually get to the Online VAT system (to hell with the VAT Number), I found I just jumped from anchor, to page, to anchor again... the destination just wasn't to be found.

Skip to the end...

So, after much bounding around, I finally decided that I'd send my registration via post—as I managed to find the seemingly correct form (that would actually open on my MacBook)—besides their phone line was consistently busy anyway. I'd also been burnt before by signing up for Government services over the phone only to be told that the conversation never took place. With post, the good thing is, you can make a hardcopy.

So, after a few over-the-top questions, and a few first-class stamps, I had my form filled out and posted. Then I waited...

and waited...

and waited...

An entire two months went by with nothing back. So I called up, and after a while of more costly waiting, I got through to a lady who could hardly tell me anything about my own registration — all in the name of security. Despite me being able to tell her everything that she could ask for, and that there isn't really anything that needs to be kept secure. How could knowing someone has applied for VAT registration be useful in any way? In the end all I could find out was that it was being processed and that my certificate would be sent out to me by second class post; which could take two weeks to reach me.

So I waited...

and waited...

Two weeks later and still nothing. So I called up again, and again could be told nothing about my registration. This time it wasn't even possible to confirm if the original certificate had been sent out... the only option offered was for the certificate to be resent (although this choice of language gave the game away). I wasn't able to pay for a courier or even a first-class stamp, nor could they email the original email address I registered with to notify me of the certificate being posted. All in all rather pathetic, and as usual way behind the services and abilities that the business world offers — yet further annoying fodder for those pesky Conservatives to argue for privatising everything.

And finally.

At time of writing I'm still waiting and am having to write Pro forma invoices, which will have to be followed up with a VAT invoice when I finally get the simple 9 characters that all this has been in aid of. The simple 9 characters that could have been sent to me securely, electronically, and not to mention — in an instant.

This world is in the state it is in due to a large number of people doing jobs that are obviously not worth doing... because they don't do them well. Namely the people who set these services up, and whose job it is to keep things improving and progressing inline with technical ability.

And before I get lynched by those who will correctly say keeping real life up-to-date to the cutting-edge is an expensive way to exist; and should not be the first goal of government or a publicly run service... surely, at the very least, we should be allowed to request a first class stamp?

They've been around a while and I'm quite sure they've been thoroughly tested, perhaps we're still waiting on the results of a royal mail feasibility study.

</rant>

describe.js - v0.3

by Developer @ pebbl.co.uk

Just a quick update to say that describe.js—whilst still supporting type-based method overloading—now supports a few extra abilities:


  1. You can now define optional parameters using tilde ~
  2. You can now create collections for constructors built by describe.make

Collections

Creating a collection is as easy as the following:


var Example = describe.make({
  'method': function(){
    alert(123);
  }
});

var collection = new Example.collection();
    collection.push( new Example() );
    collection.push( new Example() );
    collection.push( new Example() );

collection.method(); /// this will trigger alert(123) three times


This is only the basic collection implementation that I wanted to build, I need to extend the collection manipulation methods i.e. allowing for merging, filtering or collecting collections, plus I have a few more useful ideas in this regard.


Optional parameters

Optional parameters have now been reinstated, and can be implemented in the following ways:


var Example = describe.make({
  'methodA [string,~number]': function(str,num){
    console.log(arguments);
  },
  'methodB [string,number]|[string]': function(str,num){
    console.log(arguments);
  },
  'methodC [string,~number,number]': function(str,n1,n2){
    console.log(arguments);
  },
  'methodD [string,~number,~number]': function(str,n1,n2){
    console.log(arguments);
  }
});

Using [string,~number] is identical to [string,number]|[string] which is identical to creating two methods with the same name (but with differing type arguments) which execute the same function.


The difference between 'methodC [string,~number,number]' and 'methodD [string,~number,~number]' is that the following method lookups will be created inside the constructor:


/**
 * [string,~number,number] will generate:
 * 
 *   [string]
 *   [string,number,number]
 * 
 * [string,~number,~number] will generate:
 * 
 *   [string]
 *   [string,number]
 *   [string,number,number]
 */


Next steps?

I'd like to implement a few more functional "tags" that will take advantage of the new getter and setter implementations, and just generally focus on constructor properties rather than methods, as I haven't really looked at supporting them yet.


var Example = describe.make({
  'set hello': function(v){
    this._.hello = v;
  },
  'get hello': function(){
    return this._.hello;
  }
});

var a = new Example();
    a.hello = 'world';


Other tag ideas...

once

A tag that assigns a method to a constructor, but once called, the method is removed.

event

Tags every method that is used as an event listener, allowing your own code to step in and modify the event object before being used by your constructor code.

moz, opera, webkit, ms

Only assigns the method if the browser is a particular type.

describe.js - v0.2

by Developer @ pebbl.co.uk on Monday, 14 January 2013

About

Whilst working on this pebbl rewrite I've been developing a system to help me sketch object structures in JavaScript, considering it seems to have worked quite well, I thought I'd write a bit about the power of describing what you want; rather than maybe actually having it perfect right away.


For me, there are two main issues with regard to getting anything developed. The first is normally the amount of time I have free to devote to the project—gone are the days where I had weeks and weeks to code and experiment—this in itself is the main cause of my second issue; which is to always make sure code can be easily remerged, revamped and made, basically, future-indifferent... all because by the time I've started to get anywhere, it's normally time to reassess available technologies again.

CURSE YOU PROGRESS!


The plan...

So the above are my main reasons for gravitating towards scripting languages, and those specifically that allow for greater sketching and expression -- like JavaScript, Python, Lisp -- because they allow me to move faster in this crazy world. However there is always room for improvement, and after having worked on a large number of projects over the last 13 years I've been slowly aggregating a list of all the features that I expect to have in my new projects:


  1. Constructors should be easily described in a standardised way.
  2. Constructors should support multiple inheritance.
  3. Constructors should support method overloading.
  4. Constructors should support a way to "categorise" methods, taking on the power of "tagging"
  5. Constructors should support the power of collections, like how jQuery can "select" multiple elements and apply methods as a group.
  6. The structure of constructors should be separate from their implementation.
  7. The system should tie into some kind of tearDown management.
  8. The system should be extendable and have future support for the new object methods i.e. getters, setters and proxies

So, with the above in mind I constructed a system that allowed me to describe what I wanted before I had actually implemented everything.


Sorry, the phrase "cargo bay doors" is not in my lexicon

I had already decided that I wanted method overloading despite the obvious drain on performance. But then I've never liked optimising when it detracts from development speed, and considering one of my most repeated tasks was writing headers for functions that could accept a gaggle of differing arguments (Is there a collective noun for arguments?), I wasn't about to let a few milliseconds get in the way of happier coding. Besides, compared to other faux-overloading implementations I've seen around, I thought this one had merit and was possibly a fast way of doing type-based overloading:


var Example = describe.make({

  /// called when a new instance is created
  'construct': function(){
    
  },

  /// called if passed an object and a number
  'method [object,number]': function(obj,num){
    return 1;
  },

  /// called if passed a function and a number
  'method [function,number]': function(fun,num){
    return 2;
  },

  /// called if passed a function and anything else
  'method [function,*]': function(fun,any){
    return 3;
  }

});

var a = new Example();
    a.method({},123);          /// returns 1
    a.method(function(){},123) /// returns 2
    a.method(function(){},{})  /// returns 3
    a.method()                 /// trips a console error


  1. useful note :- basically the system works by processing each 'method key' and creating a lookup hash object, keyed on the string of types. Then whenever a method is called the arguments are converted into their own string of types - using a mixture of duck typing, typeof and instanceof - which is then used to look the function up from the hash. I have yet to put some real optimisation work in yet, but it already seems to operate quick enough for my needs.

As the dangerously astute may notice, the above constructor design ticks quite a few of my requested features. The structure is kept separate from the actual constructor implementation (that happens behind the scenes and means it's readily changeable), the construction follows a standard, the method key containing type definitions allows me to very visibly build overloaded methods whilst still allowing for easy change of implementation later on—basically if JS2 is ever released ;)


2X4B

What the above design doesn't make obvious is that by using a framework to construct my constructors, I can easily tie in tearDown management (e.g. introduce a 'deconstruct' standard), plus I can extend how the method keys are parsed, for example another extra that comes with the describe system—in it's current form—is the following:


var Example2 = describe.make({

  /// all methods are "public" by default, unless otherwise stated
  'public publicMethod': function(){
    
  },

  /// "static" methods are added to the constructor instead
  'static staticMethod': function(){
    
  },

  /// kept away from the public object so as to keep a clean interface
  /// not truly private however - although is open to future support.
  'private privateMethod': function(){

    /// to call this method access the ._ attribute
    this._.privateMethod();

  },

});

var b = new Example2();
    b.publicMethod();     /// all methods are "public" by default
    p.privateMethod();    /// will be undefined so will trigger an error

Example2.staticMethod();  /// "static" adds to the constructor instead

Whilst many may frown at the very suggestion of needing to "parse" anything, especially strings, I can at least argue in my defence that this parsing only occurs at set-up time. Once the constructor has been built I try an minimise the amount of processing that occurs. Obviously if you are looking for blistering performance, you don't try and bend a language to do things it's not designed for. For my own piffling forays into the scripting world though, this system works, and that's all I'm bothered about.


Back to reality

Ok, before you reach for whatever your preferred social commenting medium is, I've already thought about the problem you're first thinking of... probably not the second or third, but hey.... The first thing I'm sure others may point out is that you can't rely on typeof in all situations—those who've tried type checking arrays will be well aware of JavaScript's fickleness when it comes to types. That's why, in the spirit of future-indifference, all the type checking is run through describe.type - a function that mainly relies on duck testing (faster in my opinion that type checking, I'm not a processor though, so my opinion probably doesn't count). By keeping this check as an exposed function it is in-keeping with extensibility and will allow anyone to override it's workings—if they like.


  1. useful note :- describe.type checks all objects for a .toDescribe() method. This operates just like .toString() save for the fact it should return the type of the object - rather than it's value - as a string. If this method exists describe.type will use it's returned value instead of calculating the value itself.

In fact I've tried to keep every part of describe exposed so that it's easy to override. All I want is the framework, filled out with code that I'm happy with. Others may still find the framework useful, but hate my implementation. Therefore they can override whatever they like, this also includes how the private, public and static handling is implemented. They need look no further that the describe.tags object:


describe.tags = {
  'public': function( obj, data, workings ){
    obj.prototype[data.name] = data.prop;
  },
  'private': function( obj, data, workings ){
    if ( !obj.prototype._ ) {
      obj.prototype._ = workings._ = {};
    }
    obj.prototype._[data.name] = data.prop;
  },
  'static': function( obj, data, workings ){
    obj[data.name] = data.prop;
  }
};

As you might have discerned from the above, all you need to invent a new method "tag" is to add it to this object. At the point of creating the constructor these tag methods are called on each method that is tagged, obj refers to the constructor, data is a simple collection that describes the method or property being added; workings is a private object that can be used between tag methods as the constructor is formulated. Put simply, this system really does allow for quite a lot of control over how your constructors are put together. For example, in one of my projects I've developed a new tag called 'on' which automatically bind's each method as an event handler to the new instance being created.


Download and documentation

Describe.js is still a work in progress. In the not-too-distant-future I hope to have the following merged into the codebase:


  1. Allow for instances to be easily be grouped together and manipulated simultaneously i.e. just like jQuery can wrap multiple elements.
  2. Better implementation of multiple inheritance - describe.make does currently support this, but I'm looking to improve the implementation.
  3. Re-implement support for optional arguments. I had this in a previous version, however it got removed in the last rewrite.

For the moment though, describe.js works. So, if you're interested, you may wish to know about a few other useful methods bundled into the 8Kb that currently makes up describe.min.js:


describe( object )                          /* [string] */
describe( object, mode    /* [number] */ )  /* [string] */
describe( object, options /* [object] */ )  /* [mixed] */
describe( object, options, mode )           /* [mixed] */

  /**
   * describe() the core function is first and foremost a 
   * type guessing function. Pass in an object and it'll try
   * and tell you what it is, in string form. Currently supports 
   * the following:
   *
   *  string, number, boolean, function
   *  array, object
   *  event, window, document, element
   *
   * jQuery objects are treated as arrays, but it would be easy
   * to create a version that explicitly reported 'jquery'
   *
   * describe() also supports subtle changes in mode. For example:
   *
   * describe([123])                    /// returns 'array'
   * describe([123], describe.ARRAYS)   /// returns '[number]'
   * describe([[123]], describe.ARRAYS) /// returns '[[number]]'
   * describe([[123]], describe.ARGS)   /// returns '[array]'
   */


describe.make(
  descriptor /* [object] */
)

describe.make( 
  extensions /* [array]  */,
  descriptor /* [object] */
)

  /**
   * describe.make() as shown above constructs constructors. 
   * 
   * describe.make() uses describe's power but wraps it in a 
   * constructor/class-like object. The result is that it becomes
   * easy to describe class-like constructors that support method
   * overloading and 'method tagging' which allows you to create 
   * methods with different abilities.
   *
   * describe.make() supports inheritance using the extensions
   * array. Just pass the constructors listed in an array that you
   * wish your new constructor to extend. I hope to rework this
   * implementation shortly, as it's not quite what I want atm.
   *
   * returns the a constructor method [function]
   */


describe.construct( 
  constructor /* [function] */, 
  arguments   /* [array]    */
)

  /**
   * describe.construct() allows for the creation of new instances
   * of a constructor in a programmatical way, allowing for variable 
   * arguments.
   *
   * returns a new instance of the constructor [object]
   */


describe.proxy( 
  source          /* [object]   */,
  method          /* [string]   */,
  returnFunction  /* [function] */,
  augmentFunction /* [function] */
)

  /**
   * describe.proxy() returns a method that proxies a method
   * from the source object. You also have the option of
   * passing a function that can be used to modify the return
   * value (returnFunction), or passing a method that can 
   * modify the way the proxy method is called (augmentFunction).
   * describe.proxy is used to power describe.borrow()
   *
   * returns the proxied method [function]
   */


describe.borrow( 
  source          /* [object]       */, 
  methods         /* [array|string] */, 
  returnFunction  /* [function]     */,
  augmentFunction /* [function]     */,
  destination     /* [object]       */ 
)

  /**
   * describe.borrow() allows a destination object to "borrow"
   * a method or methods from another source object. A simple
   * example would be to have a describe'd class borrow the
   * bind and unbind methods of jQuery.
   *
   * If no destination object is specified borrow works on the 
   * current 'this' object.
   *
   * returns [undefined]
   */

describe.merge
describe.merge( 
  source     /* [function] */, 
  additional /* [function] */
)

  /**
   * describe.merge() is a relatively experimental idea at the
   * moment. It allows for a method to be merged with other
   * method(s). At the time of calling, all methods are fired.
   * currently it is only the original method's return-value that
   * gets returned, but in the future I may improve this to handle
   * a collection of return values at request.
   *
   * A simple usage example would be to late-bind an additional
   * function of code to a constructors 'construct' method.
   *
   * returns the merged [function]
   */


Example usage


Just to get the ball rolling, here is a quick example. This shows the use of namespacing to keep your describe configuration local to your code:


<script src="describe.min.js"></script>
<script>
  
  (function(describe){

    var MyConstructor = describe.make({
      'construct': function(){},
      'exampleMethod [string]': function(str){},
      'exampleMethod [number]': function(num){},
      'exampleMethod [object,array]': function(obj,arr){},
      'exampleMethod [*]': function(anything){}
    });
  
  })(describe.namespaced('my_name'));

</script>

Huh... an actual game update, really?

by Developer @ pebbl.co.uk on Wednesday, 2 January 2013

It's rather unbelivable, but I've actually managed to make some headway on Pebbl during the Christmas festivities... Oh aaaaand a merry new year by the way! So in preparation of my birthday happening in a galaxy not too far away I'd though I'd actually put something up to show that I haven't been sitting on my hands, or at least not consistently.


Be warned this is just a code demo


Obviously it doesn't appear like much at the moment--I didn't want to give too much away--but the astute of you out there will notice a few things.


  1. There isn't a shred of the original code powering this demo page.
  2. There are many shreds of original ideas woven together and put to good use.
  3. The code has evolved and benefited from another year of on/off development.
  4. The game will still be JS/HTML5 powered.
  5. The hybridisation between canvas and the DOM is even more involved.
  6. It supports Box2D for it's physical interactions!
  7. It supports require.js for the asyncronous loading.
  8. The backend (that you don't see here yet) is powered by node.js.
  9. I've ripped out my previous 'class-like' system, burnt it, blended it, spread it on toast, stuck it to the ceiling... and brought it back from the edge of the cornicing in the form of describe.js

As I stated in a previous post, the idea of this rewrite is to try and pull things away from being purely canvas based. Mainly because I found that the canvas wasn't fast enough across all the devices I tested -- whereas the dom allowed for quite smooth and fast animation. This I've achieved whilst still leaving room to switch back to a full canvas render if the future processors of this world decide to get any faster... it's likely that they will.


So now the system operates at quite a few different levels:


  1. The Box2D Physics world powers most movement.
  2. For non-physics based animation jQuery dom manipulation is used.
  3. For key-frame based animation background images and spritesheets are used on dom elements
  4. For sprites that can benefit from cloning, canvas is used instead of DOM.
  5. For masked content, pixel and lighting effects, separate canvas elements are used like dom elements.
  6. Everything is tied into jQuery's bespoke event system.
  7. With a few homemade jQuery plugins Sprites can be grouped and controlled via CSS selectors.
  8. Where possible I will try and use the up and coming CSS filters to achive effects in the game, and possibly fall back to SVG effects in older versions of FireFox.
  9. All sprites support controller objects that can be user, animation or bot controlled.

All I have left now is to rework the Map loading code so that pages can be loaded (just like in the original demo, by walking off screen) and then tie in the backend Node.js code so that a user can have an account and their progress can be logged. All in all 2012 was quite a good year ;)