Flappy bird colision help

int rectX2;
float r2;
int rectX;
float r;
float v = -1;
float y = 300;
void setup() {
  size(600, 600);
  background(0);
  r = random(50, 450);
  rectX = 550;
  r2 = random(50, 450);
  rectX2 = 1100;
}

void draw() {
  background(0);
  y+=v;
  v+=.25;
  ellipse(300, y, 50, 50); 
  ellipseMode(CENTER ); 
  rect(rectX, r - 500, 100, 500 );
  rect(rectX, r + 150, 100, 500 );
  rect(rectX2, r2 - 500, 100, 500 );
  rect(rectX2, r2 + 150, 100, 500 );
  rectX-=3; 
  if (rectX<=-50){
   rectX=rectX2 + 550;
  }
  rectX2-=3; 
  if (rectX2<=-50){
   rectX2=rectX + 550;
  }
  println(rectX,rectX2);
 }

void keyPressed() {
  if (key==' ')v-=9;
}

i need help adding collision between the circle and rectangle for flappy bird

im still new to processing and dont know how to directly implement the into my code

understand, but actually that is the point,
that you asked ? after one day play ?
for something not so basic,

and please not angry

while your game ( show ) looks like a good start!
the code not.
and i hope you allow me to show you a other way
( program structure, variable … )
what later / regarding your question / will pay off.

a rewrite of your code as a example
( sorry, no collision code )

click here

// CANVAS
int     cw = 600;
int     ch = 600;
color   cb = color(200, 200, 0);
boolean showFPS = true;

void settings() {
  size(cw, ch);
}

void setup() {
  pipe1_init();
  pipe2_init();
}

// BIRD
float   bx = 100, by = 0;
float   br = 25;
float   bv = 2, bdv = 0.25, bjv = -5;
color   bfill = color(0, 200, 0);
color   bstroke = color(200, 100, 200);
int     bstrokew = 2;

void bird() {
  fill(bfill);
  strokeWeight(bstrokew);
  stroke(bstroke);
  ellipse(bx, by, 2*br, 2*br);
  by += bv;                                  // for next draw loop
  //bv += bdv; //??
  if ( by > height - br ) by = height - br;  // stop fall down 
  if ( keyPressed && key == ' ' ) by += bjv;
}

// PIPES
float   pgap = 150, pstart = 50, pw = 100, ph = ch, pspeed = 2;
float   p1x = cw, p1y = 0;
float   p2x = 1.5*cw, p2y = 0;               // generate a uneaven space between the pipes
color   pfill = color(100, 100, 0);
color   pstroke = color(50, 50, 0);
int     pstrokew = 8;

void pipe1_init() {
  p1y = random(pstart, ch - pstart-pgap);
  println("p1x "+nf(p1x, 1, 1)+" p1y "+nf(p1y, 1, 1));
}
void pipe2_init() {
  p2y = random(pstart, ch - pstart-pgap);
  println("p2x "+nf(p2x, 1, 1)+" p2y "+nf(p2y, 1, 1));
}

void pipe() {
  fill(pfill);
  strokeWeight(pstrokew);
  stroke(pstroke);
  // pipe 1
  rect(p1x, p1y, pw, -ph);  
  rect(p1x, p1y+pgap, pw, ph);
  p1x -= pspeed;                        // pipe 1 xpos
  if ( p1x <= -pw ) { 
    p1x = cw;
    pipe1_init();                       // new random hight
  }
  // pipe 2
  rect(p2x, p2y, pw, -ph);  
  rect(p2x, p2y+pgap, pw, ph);
  p2x -= pspeed;                        // pipe 2 xpos
  if ( p2x <= -pw ) { 
    p2x = cw;
    pipe2_init();                       // new random hight
  }
}

void draw() {
  background(cb);
  if ( showFPS ) surface.setTitle("Flappy Bird "+nf(frameRate, 1, 1));
  else           surface.setTitle("Flappy Bird 1.0.1");
  bird();
  pipe();
}


GoToLoop gave you a link to a working example sketch. You read the tutorial, and you can run that circle-rect collision tutorial sketch in PDE (without changing anything) and see it working, yes?

When you say “directly implement that into my code” – what are you now trying to do, specifically, that you are having trouble with?