Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/vhiribarren/game-of-life-rust-bevy
Toy project using Rust and Bevy to developer a Conway's Game of Life
https://github.com/vhiribarren/game-of-life-rust-bevy
bevy conways-game-of-life egui rust toy-project webassembly
Last synced: about 1 month ago
JSON representation
Toy project using Rust and Bevy to developer a Conway's Game of Life
- Host: GitHub
- URL: https://github.com/vhiribarren/game-of-life-rust-bevy
- Owner: vhiribarren
- License: mit
- Created: 2023-08-29T19:28:04.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-09-17T18:39:46.000Z (over 1 year ago)
- Last Synced: 2024-04-24T03:19:11.565Z (8 months ago)
- Topics: bevy, conways-game-of-life, egui, rust, toy-project, webassembly
- Language: Rust
- Homepage: https://workshop.alea.net/game-of-life-rust-bevy/
- Size: 537 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Conway's Game of Life
![Game of Life screenshot](material/screenshot_1.png)
## How to run
### Hosted demo
Just go to https://workshop.alea.net/game-of-life-rust-bevy/
### Native window
To run with a native window:
cargo run --release
### WASM version in web browser
To run the WebAssembly version, as suggested the [Bevy
Cheatbook](https://bevy-cheatbook.github.io/platforms/wasm.html),
`wasm-server-runner` can be used:rustup target install wasm32-unknown-unknown
cp .cargo/config.toml.example .cargo/config.toml
cargo install wasm-server-runnerNow, a local web server is launched with the compiled WASM file when the
following command is launched:cargo run --target wasm32-unknown-unknown
If you've copied the `config.toml`, this alias command can also be used:
cargo serve
## WASM distribution
Setup your environment:
rustup target add wasm32-unknown-unknown
cargo install wasm-bindgen-cliYou can then build the WASM file and generate the JS file:
cargo build --release --target wasm32-unknown-unknown
wasm-bindgen --no-typescript --out-dir ./webapp/ --target web ./target/wasm32-unknown-unknown/release/game-of-life.wasmEverything is then in the `/webapp/` folder and ready to be copied on your web server.
You can even launch a local web server with Python:python3 -m http.server --directory webapp/
## Development
### Pre-commit hooks
Some git [pre-commit] hooks are available. You can install them using:
$ pre-commit install
[pre-commit]: https://pre-commit.com/
## License
MIT License
Copyright (c) 2023 Vincent Hiribarren
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.