code: function (dt) {
  
          if (this.alive)    {
              if (this.walkLeft && this.pos.x <= this.startX) {
                  this.body.force.x = Math.abs(this.body.force.x);
                  this.walkLeft = false;
                  this.renderable.flipX(true);
              } else if (!this.walkLeft && this.pos.x >= this.endX) {
                  this.body.force.x = -Math.abs(this.body.force.x);
                  this.walkLeft = true;
                  this.renderable.flipX(false);
              }
  
              // check & update movement
              this.body.update(dt);
  
          }
  
          // return true if we moved of if flickering
          return (this._super(me.Entity, "update", [dt]) || this.body.vel.x !== 0 || this.body.vel.y !== 0);
      }
docs: manage the enemy movement