Blinking random objects in arrays

hi I really need some tips, I’m trying to make my object array “blink” once it’s executed, the 10 ellipses in the array appear in random positions, and then they flash in and out while staying in that initial random position. Their position changes for every time the code is run but they always blink, all at the same time, staying in their spawned positions.
I’m not sure how to approach this, I tried putting background(); in void draw after the array but there’s gotta be a more efficient way, please help

I only have the 10 ellipse array so far, any advice would be greatly appreciated

Mines[] mines = new Mines [10];

void setup() {
  size(1200, 600);
  for(int i = 0; i < mines.length; i++){
  mines[i] = new Mines ();
}
}


void draw() {
  background(255);
  for(int i = 0; i < mines.length; i++){
    mines[i].display();
}
}



class Mines {
  float x;
  float y;
  int diameter;

  Mines() {
    x = random(15, width - diameter);
    y = random(15, height - diameter);
    diameter = 30;
  }

  void display() {
    noStroke();
    fill(0);
    ellipse(x, y, diameter, diameter);
  }
}

I managed to get them flashing but it’s way too fast, I’m hoping to get a slow blinking, I don’t know how to get any further than this pls help, anyway to make it blink slower? new parts is void blinkCheck(); and void count();

Mines[] mines = new Mines [10];
int count =1;
boolean blinkM = true;
int diameter= 30;
void setup() {
  size(1200, 600);
  for(int i = 0; i < mines.length; i++){
  mines[i] = new Mines ();
}
}


void draw() {
  background(255);
  for(int i = 0; i < mines.length; i++){
    mines[i].display();
}
blinkCheck();
count();
}



class Mines {
  float x;
  float y;
  

  Mines() {
    x = random(15, width - diameter);
    y = random(15, height - diameter);
    diameter = 30;
  }

  void display() {
    noStroke();
    fill(0);
    ellipse(x, y, diameter, diameter);
  }
}


void blinkCheck(){
  if(count % 2 == 1){
    blinkM = true;  }
    else {blinkM = false;}
    
   if (blinkM == true){
     diameter = 30; }
     else {diameter = 0;}
}

void count(){
  count++;
}

finally managed to work it out with great help from someone, problem was in void blinkCheck(){}

  void display() {
    if (count % 60 < 30) {
      blinkM = true;
    } else {
      blinkM = false;
    }

    if (blinkM == true) {
      diameter = 30;
    } else {
      diameter = 0;
    }
    noStroke();
    fill(0);
    ellipse(x, y, diameter, diameter);
  }
}

void count() {
  count++;
}
1 Like