wasmlife
is an awesome Life (Conway's Game Of Life) implementation in Go ❤️ WebAssembly.
Life board is represented in a 64-bit 2D space.
Since living cells are sparse we used hash map representing a sparse matrix to only track living cells.
On each tick we visit all the neighbors of each cell and compute the next generation.
For visualization, we used Ebiten, a simple 2d game library for Go, which also allows us to compile to WebAssembly.
Go must be installed on your system.
Standard
make build
WebAssembly
make wasm
Run without building
make run
GitHub-Actions builds and auto-commits built WebAssembly binary to /docs
directory.
GitHub-Pages deploys latest binary automatically.
Latest WebAssembly build is visible on GitHub-Pages
Many improvements can be made to this project for better UI/UX.
Such as:
- Be able to pan Viewport and/or pan to a specific location.
- Better UI design for taking input.
- Be able to reset the game at runtime.
MIT Licensed