AI to control a Ping Pong paddle
Using a mechanical refactoring approach, you could create an array of objects to encapsulate the offsets and values associated with each offset:
movement(_b) {
  let centerOfPaddle = this.y + this.height / 2;

  let offsets = [
    { offset: 80, value: 4 },
    { offset: 60, value: 2 },
    { offset: 40, value: 1 },
    { offset: 20, value: 0.5 },
  ];

  for (const { offset, value } of offsets) {
    if (centerOfPaddle &lt; _b.y - offset) {
      this.y += value;
      break;
    } else if (centerOfPaddle &gt; _b.y + offset) {
      this.y -= value;
      break;
    }
  }
}

Going further, you could do a more conceptual refactoring and figure out the math behind your logic. For example:
movement(_b) {
  let centerOfPaddle = this.y + this.height / 2;

  for (let i = 80, j = 4; i &gt;= 20; i -= 20, j /= 2) {
    if (centerOfPaddle &lt; _b.y - i) {
      this.y += j;
      break;
    } else if (centerOfPaddle &gt; _b.y + i) {
      this.y -= j;
      break;
    }
  }
}

You could give those loop variables more appropriate names like offset and value.