BREAKOUT Project - Help with collision detection

sorry, as a next step i would use array for the brick positions too

int[] blocks  = new int[50];
int[] blocksx = new int[50];
int[] blocksy = new int[50];
int bh = 30; //Hauteur 
int bw = 100; //Largeur
int boff = 10;

void setup() {
  size(1200, 800);
  for (int i=0; i<50; i++) {
    blocks[i] = 1;
    blocksx[i] =  i%10*(bw + boff) + 50; 
    blocksy[i] =  floor(i/10) * ( bh + boff) + 20;
  }
}

void draw() {
  for (int i=0; i < 50; i++) {
    if (blocks[i]==1) { 
      fill(255);
      stroke(0);
      rect(blocksx[i], blocksy[i], bw, bh);
    }
  }
}

you see how easy it makes the drawing,
sure it will help with the collision