Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/elliotb256/bevy_combat
A sci-fi battle simulation implemented in the bevy engine.
https://github.com/elliotb256/bevy_combat
bevy ecs scifi space
Last synced: 2 months ago
JSON representation
A sci-fi battle simulation implemented in the bevy engine.
- Host: GitHub
- URL: https://github.com/elliotb256/bevy_combat
- Owner: ElliotB256
- License: mit
- Created: 2021-12-06T22:16:12.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2024-03-16T10:38:12.000Z (9 months ago)
- Last Synced: 2024-10-11T06:01:13.708Z (2 months ago)
- Topics: bevy, ecs, scifi, space
- Language: Rust
- Homepage:
- Size: 6.13 MB
- Stars: 69
- Watchers: 5
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# Bevy Combat
[![crate_version](https://img.shields.io/crates/v/bevy_combat.svg?style=flat)](https://crates.io/crates/bevy_combat)
[![crate_version](https://img.shields.io/badge/docs-latest-blue.svg?style=flat)](https://docs.rs/bevy_combat)It's a bevy port of my [ECS Combat](https://github.com/ElliotB256/ECSCombat/) Unity demo.
Check out the [web demo](https://elliotb256.github.io/bevy_combat/) in your browser.
You can use the - and = keys to speed up and slow down time (make sure you have focussed the browser window).![demo scene](media/demo.gif)
![another scene](media/thumbnail.gif)
## Added so far
* Movement
* Combat and targetting AI
* Simple weapons (instant hit), damage, health and mortality
* Death animations and explosions
* Shields## Coming soon
* More weapons
* Combat calculations, e.g. weapon effectiveness.
* Ship shaders
* Fix bugs## Getting Started
To build and deploy for web:
```
cargo make serve
```To run for pc:
```
cargo run
```## Building for web (fast)
Make sure you have added the wasm target to your toolchain:
```
rustup target add wasm32-unknown-unknown
```If you do not have `wasm-server-runner`, install it via
```
cargo install wasm-server-runner
```Afterwards, you can build and run in your browser:
```
cargo run --target wasm32-unknown-unknown
```For more info on web deployment, see [the bevy book](https://bevy-cheatbook.github.io/platforms/wasm.html).
### Building for itch.io
Following [these instructions](https://bevy-cheatbook.github.io/platforms/wasm/webpage.html)...
itch.io build requires
```
cargo install wasm-bindgen-cli
```Build the wasm target, then run `wasm-bindgen`. After, optimize the generated `.wasm`:
```
cargo build --release --target wasm32-unknown-unknown
wasm-bindgen --no-typescript --target web --out-dir ./out/ --out-name "game" ./target/wasm32-unknown-unknown/release/bevy_combat.wasm
```If you want to optimize further:
```
wasm-bindgen --no-typescript --target web --out-dir ./out/ --out-name "preopt_game" ./target/wasm32-unknown-unknown/release/bevy_combat.wasm
wasm-opt -O -ol 100 -s 100 -o game.wasm preopt_game.wasm
```
Copy the assets folder to `/out`. Copy `web/index.html` to `/out/index.html`Zip the `out` folder, upload to itch.io, and celebrate!
## Credits
Credit for individual art assets can be found [here](assets/credits.md).