Skip to content

kunallanjewar/wasmlife

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

wasmlife

wasmlife is an awesome Life (Conway's Game Of Life) implementation in Go ❤️ WebAssembly.

Implementation

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.

Build

Go must be installed on your system.

Standard

make build

WebAssembly

make wasm

Run without building

make run

CICD

GitHub-Actions builds and auto-commits built WebAssembly binary to /docs directory.

GitHub-Pages deploys latest binary automatically.

Demo

Latest WebAssembly build is visible on GitHub-Pages

Improvements

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.

License

MIT Licensed

About

Conway's Game of Life (B3/S23) written in Go ❤️ WebAssembly

Resources

Stars

Watchers

Forks