var BY, BX, T, BDY, BDX;
var Pb, Bot;
var PtsA = 0, PtsB = 0;
function setup() {
  background(0); 
  createCanvas(1080, 720);
  BY = height/2;
  BX = width/2;
  BDY = random(-7, 7);
  BDX = 2;
  T = random(1, 10);
  Pb = height/2-15;
}

function draw() {
  background(0);
  textSize(20);
  fill(255);
  text("©Javi", width-55, height-10);
  //puntos
  textSize(100);
  fill(255);
  text(PtsA, width*0.25, height/2);
  text(PtsB, width*0.75, height/2);
  //jugadores
  fill(255);
  rect(width-15, mouseY, 15, 60);
  rect(0, Pb, 15, 60);
  //linea centro
  rect(width/2-5, 0, 10, height);
  //pelota
  fill(150, 0, 0);
  ellipse(BX, BY, 50, 50);
  //bot
  if (BX < width/2 && Pb > 0 && Pb < width-60) {
    if (Bot == 0) {
      Pb = BY - 30;
    } else {
      if (Pb > BY) {
        Pb = Pb - T;
      }
      if (Pb < BY) {
        Pb = Pb + T;
      }
      if (Pb < BY + 30 && Pb > BY -30) {
        Bot = 0;
      }
    }
  }
  //direccion pelota
  if (BDX == 1) {
    BX = BX - 3;
  }
  if (BDX == 2) {
    BX = BX +3;
  }
  //pelota arriba/abajo
  BY = BY - BDY;
  //choque 
  if (BY < 25 || BY > height-25) {
    BDY = BDY * -1;
  } 
  if (BX > width-25 && BY < mouseY + 60 && BY > mouseY) {
    BDX = 1;
    BDY = random(-7, 7);
    T = T -1
      Bot = 1;
  }
  if (BX < 25 && BY < Pb + 60 && BY > Pb) {
    BDX = 2;
    T = T - 1;
    BDY = random(-7, 7);
    Bot = 1;
        if (Pb < 0) {
     Pb = 1;
    }
      if (Pb < width-60) {
     Pb = width-59;
    }
  }
  //reset
  if (BX == 0) {
    PtsB = PtsB + 1;
    BY = height/2;
    BX = width/2;
    BDY = random(-7, 7);
    BDX = 2;
    T = random(1, 10);
        if (Pb < 0) {
     Pb = 1;
    }
      if (Pb > width-60) {
     Pb = width-59;
    }
  }
  if (BX == width) {
    PtsA = PtsA + 1;
    BY = height/2;
    BX = width/2;
    BDY = random(-7, 7);
    BDX = 2;
    T = random(1, 10);
    if (Pb < 0) {
     Pb = 1;
    }
      if (Pb > width-60) {
     Pb = width-59;
    }
  }
}

@@ -655,46 +655,75 @@
 if (
-BX %3C width/2 && Pb %3E 0 &&
+Pb %3C 0) %7B%0A   Pb = 1; %0A  %7D%0A  %0A  if (Pb %3E width-60) %7B%0A  
  Pb 
-%3C
+=
  width-6
 0) %7B
@@ -710,33 +710,58 @@
 %0A   Pb = width-6
-0
+1; %0A  %7D%0A  if (BX %3C width/2
 ) %7B%0A    if (Bot 
@@ -1430,106 +1430,12 @@
  1;%0A
-        if (Pb %3C 0) %7B%0A     Pb = 1;%0A    %7D%0A      if (Pb %3C width-60) %7B%0A     Pb = width-59;%0A    %7D%0A
   %7D%0A
+
   //
@@ -1580,102 +1580,8 @@
 0);%0A
-        if (Pb %3C 0) %7B%0A     Pb = 1;%0A    %7D%0A      if (Pb %3E width-60) %7B%0A     Pb = width-59;%0A    %7D%0A
   %7D%0A
@@ -1689,32 +1689,32 @@
 );%0A    BDX = 2;%0A
+
     T = random(1
@@ -1724,98 +1724,8 @@
 0);%0A
-    if (Pb %3C 0) %7B%0A     Pb = 1;%0A    %7D%0A      if (Pb %3E width-60) %7B%0A     Pb = width-59;%0A    %7D%0A
   %7D%0A

Update Pong.js