https://github.com/healeycodes/boids
🦢 The boids flocking simulation in Wasm using Ebiten!
https://github.com/healeycodes/boids
boids ebiten flocking go go-game go-wasm wasm
Last synced: about 1 month ago
JSON representation
🦢 The boids flocking simulation in Wasm using Ebiten!
- Host: GitHub
- URL: https://github.com/healeycodes/boids
- Owner: healeycodes
- License: mit
- Created: 2020-07-21T20:45:20.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2020-07-31T10:15:20.000Z (about 5 years ago)
- Last Synced: 2025-04-30T09:55:55.467Z (5 months ago)
- Topics: boids, ebiten, flocking, go, go-game, go-wasm, wasm
- Language: Go
- Homepage: https://healeycodes.com/boids-flocking-simulation/
- Size: 26 MB
- Stars: 63
- Watchers: 3
- Forks: 5
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## Boids with Go and Ebiten
> My blog post: [Boids in WebAssembly Using Go](https://healeycodes.com/boids-flocking-simulation/)
👉🏻 [Demo link](https://healeycodes.github.io/boids/) to the WASM version.
I wrote this program, an implementation of Craig Reynolds' _Boids_, in order to learn more about deploying Go on the web, and to tackle a problem that escaped me when I was learning to code!

### Possible improvements
- Field of vision support (boids shouldn't look behind 👀)
- QuadTree optimization
- Different `maxSpeed`/`maxForce` for each boid
- Graphical interface for live-editing of values
- Use a snapshot for each 'generation'
- ..
### Run 🦢
```
go run main.go
```### Build 🕊
```
GOOS=js GOARCH=wasm go build -o dist/boids.wasm github.com/healeycodes/boids
```This compiles the program into WebAssembly in the `dist` folder.
The simulation can be viewed in a web browser via `index.html`. To get this working locally, you may need to serve the files from a web server.
License: MIT.