Boids flocking · muse-spark-1.2
Output generated Cost / run $0.0689 Runtime 47.2s
Prompt for this run
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.
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
METRICS
Transcript · 6 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.
index.html (29291 bytes)Successfully wrote 29291 bytes to index.html
{"command":"ls -lh index.html && wc -l index.html"}-rw-r--r--. 1 node node 29K Aug 13 01:24 index.html 722 index.html
Flocking simulation written to `index.html` — single self-contained file, no external resources. **Features:** - 120 boids (20–220 slider) as velocity-oriented triangles with heading-colored bloom - Full Reynolds flocking: **Separation / Alignment / Cohesion** with independent weights, perception radius, and separation distance sliders - **Smooth steering:** acceleration integration, speed limiting, `maxForce` (agility) capping per behavior, toroidal neighbor distance - **Mouse predator:** cursor projects a radial "flee" field (tunable flee strength + radius); boids apply exponential evasion force — move to scatter, click to burst new boids outward - Wrap / bounce edges, motion-trail fade, neighbor-link overlay, scatter/add/reset controls - Keyboard: `Space` pause, `R` reset, `S` scatter