This is just a quick suggestion/fix:

ig.Game.inject(
{
    spawnEntity : function(type, x, y, settings)
    {
        // when we add a new entity, lets sort things out
        // think of the ui
        this._doSortEntities = true;
        return this.parent(type, x, y, settings);
    }
})