GitPedia

Boids

๐Ÿฆข The boids flocking simulation in Wasm using Ebiten!

From healeycodesยทUpdated February 1, 2026ยทView on GitHubยท

> My blog post: [Boids in WebAssembly Using Go](https://healeycodes.com/boids-flocking-simulation/) The project is written primarily in Go, distributed under the MIT License license, first published in 2020. Key topics include: boids, ebiten, flocking, go, go-game.

Boids with Go and Ebiten

My blog post: Boids in WebAssembly Using Go

<br>

๐Ÿ‘‰๐Ÿป Demo link 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!

<br>

Animated GIF of a flocking simulation

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'
  • ..
<br>

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.

<br>

License: MIT.

Contributors

Showing top 1 contributor by commit count.

View all contributors on GitHub โ†’

This article is auto-generated from healeycodes/boids via the GitHub API.Last fetched: 6/29/2026