Boids flocking · muse-spark-1.2
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 · 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
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 smoothly with cursor evasion glow, click adds boids and space toggles pause; arrows/wasd have no distinct effect.
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.