Change colors on different objects blinking

Hi @vrtx :slightly_smiling_face:

The code above is just an example of how to use the createGraphics function.
Use that example as a reference to make adjustments to your flower code in the mousePressed section.
Your code should look like this now:

if (mousePressed == true) {
    
    flowers.beginDraw(); //***new line
    
    angle += 5;
    float val = cos(radians(angle)) * 12.0;
    for (int a = 0; a < 360; a += 75) {
      float xoff = cos(radians(a)) * val;
      float yoff = sin(radians(a)) * val;
      
      flowers.fill(0); //*** new line
      flowers.ellipse(mouseX + xoff, mouseY + yoff, val, val); //*** new line
    }
      
    flowers.fill(255); //*** new line
    flowers.ellipse(mouseX, mouseY, 2, 2); //*** new line
    flowers.endDraw(); //*** new line
  }
  image(flowers, 0, 0); //*** new line
}

I hope this helps!
:nerd_face:

2 Likes