Boids flocking · gpt-5-mini
Create a full-screen flocking simulation of boids using separation, alignment, and cohesion, drawn as oriented triangles that steer smoothly and flee from the mouse cursor.
transcript · 4 messages
Create a full-screen flocking simulation of boids using separation, alignment, and cohesion, drawn as oriented triangles that steer smoothly and flee from the mouse cursor.
thinking
**Implementing boid dynamics** I'm thinking about how to implement the fleeing behavior for my boids. If the distance is less than the flee radius, I'll calculate the desired direction towards a position minus the mouse. Normalizing that and applying a speed, then considering scaling factors seem vital. I also plan to make the canvas responsive, adjusting sizes on window resizing. The default count for boids might be around 150, and I’m contemplating some UI instructions too. Time to get to writing the code!
index.html (11419 bytes)Successfully wrote 11419 bytes to index.html
I created a single-file fullscreen flocking simulation (index.html) that implements separation, alignment, cohesion, and a mouse-flee behavior. Boids are drawn as oriented triangles, steer smoothly, wrap at edges, and you can add boids with mouse clicks, pause with Space, and adjust count with +/-. Open index.html in a browser to run it.
TAKE IT TO CODE
A single self-contained HTML file — copy it and open in any browser, or reuse the prompt with your own pi-agent run.
RUN
EVALUATION
Boids flock and swirl smoothly with oriented triangles; click adds boids, arrows/wasd have no visible effect (likely unbound).
Vision grade · anthropic/claude-sonnet-5
MEASUREMENTS
Raw readings from the capture, not a verdict — the grade above is the only judgement. Percentages are how much of the screen changed; the measure under-reports sparse motion on a dark background.