Analysis updated 2026-06-24
Prototype a crowd scene for a browser game without any sprite sheet work
Teach how row-slicing plus sine-wave shifts fakes a walk cycle
Drop new four-direction characters into a static PNG folder
Stress-test 2D canvas with thousands of tinted sprites
| boona13/crowds-system-js | 0xsha/cve-2026-6307 | flyfish-dev/file-viewer | |
|---|---|---|---|
| Stars | 43 | 38 | 50 |
| Language | HTML | HTML | HTML |
| Setup difficulty | easy | hard | easy |
| Complexity | 2/5 | 5/5 | 2/5 |
| Audience | developer | developer | developer |
Figures from each repo's GitHub metadata at analysis time.
No build step, just serve the folder with any static file server.
crowds-system-js is a zero-dependency, single-file browser playground that simulates hundreds to thousands of pedestrians wandering on an HTML canvas. There are no sprite sheets, no skeletons, and no GPU shaders involved. Every character is a static four-direction PNG that gets sliced into horizontal rows and animated with simple 2D canvas calls, which is enough to make a single image read as a full walk cycle. The trick the README describes works like this. For each person the engine keeps a four-direction base sprite (down, up, left, right), a shirt colour picked from a small palette, and a gait phase that advances each frame. The renderer cuts the sprite into a configurable number of slices and shifts them with a sine wave driven by the gait phase. Rows below the hip line act as legs and swing forward and back, rows above act as torso and head and sway with a counter-motion. At foot-plant moments the legs squash vertically. Tinted canvases are cached per hue, so the 2D context only sees N times M textures for N characters and M shirt colours. The author claims 2000 plus pedestrians at 60 fps in a regular browser tab. Running it needs no build step. You just serve the folder over a static file server (python3 -m http.server 8000, or npx serve .) and open localhost in a browser. Keys 1 through 4 switch between wander, crossroads, circle orbit, and follow-cursor mob modes. Space pauses, R respawns, D toggles debug rings. A right-side panel exposes every tweakable parameter live, including count, size, palettes, slice count, bob amplitude, body sway, head counter-sway, leg swing, foot-plant squash, lean, hip line, cadence, cadence variance, forward speed, turn rate, mode, and ground theme. The repo ships four hand-drawn characters (little girl, dad, grandfather, grandmother) plus a generic hero sprite in four facings. The character folder is intentionally misspelled as charachters because it mirrors the upstream game project's hard-coded path. Adding a new character means dropping a folder of four named PNGs and adding an entry to the CHARACTERS array around line 690 of index.html, the sprite-grid UI picks it up on next load. The project is MIT-licensed and made by Ibrahim Boona, who lists X, Instagram, and GitHub handles in the README.
Single-file HTML canvas playground that animates 2000+ pedestrians from static four-direction PNGs by slicing rows and shifting them with a sine wave.
Mainly HTML. The stack also includes HTML, JavaScript, Canvas.
MIT license, free to use, modify, and redistribute with attribution.
Setup difficulty is rated easy, with roughly 5min to a first successful run.
Mainly developer.
This repo across BitVibe Labs
Verify against the repo before relying on details.