Not sure why my array is not allowed to use a function (OOP)

int savedTime;
float totalTime = 5000;
float black = 0;
Triangles[] tri = new Triangles[18];


void setup()
{
  size(900, 900);
  background(0);
  savedTime = millis();
  float y = 0;
  float x = 0;
  for (int i = 0; i < tri.length; i++) {

    tri[i] = new Triangles(x, y);
  }
}



void draw()
{
  background(220);


  for (float x = 25; x < width; x+=50) {
    for (float y = 0; y < height; y+=50) {
      for (int i = 0; i < tri.length; i++) {


        tri[i].change();
        tri[i].display();
      }
    }
  }




  class Triangles {

    float x = 0.0;
    float y =0.0;



    Triangles(float tempX, float tempY) {

      x = tempX;
      y = tempY;
    }



    void display()
    {

      triangle(x, y, x+25, y+50, x-25, y+50);
    }
  }



  void change() {
    int passedTime = millis() - savedTime;
    totalTime = random(0, 5000);
    if (passedTime > totalTime) {
      noStroke();
      fill(black);
      black += 1;
      if (black == 255) {
        black = 0;
        savedTime = millis();
      }
    }
  }
}

probably time to go back to the drawing board, i feel like this is just further away than before.

I really do appreciate the help though so thankyou.