define(['scripts/feierabend/viewable.js', 'scripts/feierabend/collectable.js', 'scripts/feierabend/movable.js'], function (createViewable, createCollectable, createMovable) {
    return function createWorkmate(number, texture, game, enterGrid) {
        var followingPlayer = null;
        var positionInQueue = 0;
        var followPlayer= function followPlayer(player) {
            positionInQueue = player.workmatesFollowing.length;
            player.workmatesFollowing.push('workmate' + number);
            followingPlayer = player;
        };
        var collideFn = function collideFn(collideObj, thisWorkmate) {
            if (collideObj.id === 'player') {
                if(followingPlayer) {
                    console.log('player hits ' + thisWorkmate.id);
                } else {
                    followPlayer(collideObj);
                }
            }
        };
        var Workmate = {
            move: function move() {
                if(followingPlayer) {
                    var followMovement1 = followingPlayer.getPathMovement(positionInQueue);
                    var followMovement2 = followingPlayer.getPathMovement(positionInQueue+1);
                    this.setRotationByDirection(followMovement1.direction);
                    this.moveSpriteTo(this.getSprite(), followMovement2.tile);
                }
            },
        };

        var workmateInstance = Object.create(Workmate);
        workmateInstance = $.extend({}, createCollectable('workmate' + number, texture, game, collideFn, enterGrid), workmateInstance, createMovable(game));
        return workmateInstance;
    };

});

@@ -332,16 +332,17 @@
 owPlayer
+ 
 = functi
@@ -359,32 +359,32 @@
 layer(player) %7B%0A
-
             posi
@@ -720,16 +720,18 @@
         
+//
 console.
@@ -908,16 +908,43 @@
 ate = %7B%0A
+            isSolid: true,%0A
         
@@ -1033,31 +1033,33 @@
     var 
-followMovement1
+queuePosDirection
  = follo
@@ -1127,30 +1127,32 @@
     var 
-follow
+queuePos
 Movement
 2 = foll
@@ -1143,17 +1143,16 @@
 Movement
-2
  = follo
@@ -1250,23 +1250,25 @@
 ion(
-followMovement1
+queuePosDirection
 .dir
@@ -1336,22 +1336,24 @@
 (), 
-follow
+queuePos
 Movement
 2.ti
@@ -1352,9 +1352,8 @@
 ment
-2
 .til

refactor workmate