51 lines, 7 of them comments ยท 528 tokens, written in 6 seconds for $0.0029


 1  let circles = [];
 2  
 3  function setup() {
 4    createCanvas(800, 600);
 5    
 6    // Initialize circles
 7    for (let i = 0; i < 8; i++) {
 8      circles.push({
 9        x: random(width),
10        y: random(height),
11        size: random(20, 80),
12        speedX: random(-2, 2),
13        speedY: random(-2, 2),
14        hue: random(360),
15        growSpeed: random(0.5, 2)
16      });
17    }
18    
19    colorMode(HSB, 360, 100, 100);
20  }
21  
22  function draw() {
23    background(20, 20, 30);
24    
25    // Update and draw circles
26    for (let circle of circles) {
27      // Update position
28      circle.x += circle.speedX;
29      circle.y += circle.speedY;
30      
31      // Wrap around edges
32      if (circle.x > width + 50) circle.x = -50;
33      if (circle.x < -50) circle.x = width + 50;
34      if (circle.y > height + 50) circle.y = -50;
35      if (circle.y < -50) circle.y = height + 50;
36      
37      // Update size with oscillation
38      circle.size += circle.growSpeed;
39      if (circle.size > 100 || circle.size < 20) {
40        circle.growSpeed *= -1;
41      }
42      
43      // Update hue
44      circle.hue = (circle.hue + 1) % 360;
45      
46      // Draw circle
47      fill(circle.hue, 80, 100, 0.6);
48      noStroke();
49      ellipse(circle.x, circle.y, circle.size);
50    }
51  }