game.js
function(namespacedEvent, callback) {
      var event, namespace, _ref;
      _ref = namespacedEvent.split("."), event = _ref[0], namespace = _ref[1];
      if (namespace) {
        callback.__PIXIE || (callback.__PIXIE = {});
        callback.__PIXIE[namespace] = true;
      }
      eventCallbacks[event] || (eventCallbacks[event] = []);
      eventCallbacks[event].push(callback);
      return this;
    }
function(namespacedEvent, callback) {
      var event, namespace, _ref;
      _ref = namespacedEvent.split("."), event = _ref[0], namespace = _ref[1];
      if (namespace) {
        callback.__PIXIE || (callback.__PIXIE = {});
        callback.__PIXIE[namespace] = true;
      }
      eventCallbacks[event] || (eventCallbacks[event] = []);
      eventCallbacks[event].push(callback);
      return this;
    }
function ( namespacedEvent , callback ) { var event , namespace , _ref ; _ref = namespacedEvent . split ( "." ) , event = _ref [ 0 ] , namespace = _ref [ 1 ] ; if ( namespace ) { callback . __PIXIE || ( callback . __PIXIE = { } ) ; callback . __PIXIE [ namespace ] = true ; } eventCallbacks [ event ] || ( eventCallbacks [ event ] = [ ] ) ; eventCallbacks [ event ] . push ( callback ) ; return this ; }
Adds a function as an event listener.

# this will call coolEventHandler after
# yourObject.trigger "someCustomEvent" is called.
yourObject.on "someCustomEvent", coolEventHandler

#or
yourObject.on "anotherCustomEvent", ->
doSomething()

@name on
@methodOf Bindable#
@param {String} event The event to listen to.
@param {Function} callback The function to be called when the specified event
is triggered.
Adds a function as an event listener .