Skip to content

A Rust + WebAssembly implementation of the game of life

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT
Notifications You must be signed in to change notification settings

TGianella/game-of-life

Repository files navigation

Game of life

Rust WebAssembly JavaScript HTML

A web app implementing the game of life, done in Rust + WebAssembly + Js, following the community's guide.

In order to compare performances, the calculation is implemented both in pure JS and in Rust/Wasm, switch between the two by clicking the logo in the top-left !

Play with it here.

Features

  • It runs fast (fps counter included)
  • Wrapping universe (cells on the left/top border are neighbours to those on the right/bottom border)
  • Play/Pause simulation at anytime.
  • Slider to control the simulation speed.
  • Reset or clear the board.
  • Click to change a cell state, ctrl-click to create a glider, shift-clitk to create a pulsar
  • Modify the board size and cell size
  • Optionally resets the board after some time or when it is dead

Features I'd like to implement

Features

  • Select menu to select shape added on ctrl and maj-click
  • Rotate shapes
  • Go back in time (highly unrealistic right now !)

Optimisation

  • Transition from canvas to webGL for rendering
  • Remove allocation of vectors at each universe tick
  • Return list of deltas instead of a whole univers with each tick
  • Instantiate only a single universe to remove all dynamic allocation.

About

A Rust + WebAssembly implementation of the game of life

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published