var BattleOfDebilism = BattleOfDebilism || {};

BattleOfDebilism.messageHandlers = {
  login: function (message) {
    BattleOfDebilism.player = BattleOfDebilism.utils.createPlayer(message.playerId, BattleOfDebilism.playersGroup);
  },
  newPlayer: function (message) {
    BattleOfDebilism.enemies.push(BattleOfDebilism.utils.createPlayer(message.playerId, BattleOfDebilism.playersGroup, message.position));
  },
  deletePlayer: function (message) {
    var player =_.remove(BattleOfDebilism.enemies, {id: message.playerId})[0];
    player.sprite.kill();
  },
  position: function (message) {
    var enemy =_.find(BattleOfDebilism.enemies, {id: message.playerId});
    enemy.sprite.position.x = message.x;
    enemy.sprite.position.y = message.y;
  },
  fire: function (message) {
    BattleOfDebilism.utils.enemyFire(message.playerId, message.pointer);
  }
};
@@ -660,16 +660,382 @@
 erId%7D);%0A
+    var sprite = enemy.sprite;%0A    var lastX = enemy.sprite.position.x;%0A    var dx = Math.abs(lastX - message.x);%0A    if (dx %3C 0.5) %7B //almost no movement%0A      sprite.animations.stop();%0A      sprite.frame = 0;%0A    %7D else if (lastX %3E message.x) %7B%0A      sprite.animations.play('left');%0A    %7D else if (lastX %3C message.x) %7B%0A      sprite.animations.play('right');%0A    %7D%0A
     enem

fix animations