Skip to content

Commit

Permalink
Make the demos bins instead of examples
Browse files Browse the repository at this point in the history
  • Loading branch information
idanarye committed Feb 19, 2024
1 parent 69bca69 commit 4e81032
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -181,15 +181,15 @@ jobs:
for physics_backend in rapier xpbd; do
cargo build \
--package tnua-demos-crate \
--examples \
--bins \
--release \
--features ${physics_backend}2d \
--features ${physics_backend}3d \
--features bevy/webgl2 \
--target wasm32-unknown-unknown
for demowasm in $(cd target/wasm32-unknown-unknown/release/examples; ls *.wasm | grep -v -); do
for demowasm in $(cd target/wasm32-unknown-unknown/release; ls *.wasm | grep -v -); do
variant=${demowasm%.*}-$physics_backend
wasm-bindgen target/wasm32-unknown-unknown/release/examples/$demowasm --out-dir target/doc/demos/ --out-name $variant --target web
wasm-bindgen target/wasm32-unknown-unknown/release/$demowasm --out-dir target/doc/demos/ --out-name $variant --target web
cat > target/doc/demos/$variant.html <<EOF
<html lang="en-us">
<head>
Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,28 +31,28 @@ Tnua can use [Rapier](https://rapier.rs/) or [XPBD](https://github.com/Jondolf/b
* [Jump/fall through platforms](https://github.com/idanarye/bevy-tnua/wiki/Jump-fall-Through-Platforms)
* Air actions

## Examples:
## Demos:

| Example | Rapier | XPBD |
| Demo | Rapier | XPBD |
|---------------|-----------------------------------------------------------------|---------------------------------------------------------------|
| 2D Platformer | https://idanarye.github.io/bevy-tnua/demos/platformer_2d-rapier | https://idanarye.github.io/bevy-tnua/demos/platformer_2d-xpbd |
| 3D Platformer | https://idanarye.github.io/bevy-tnua/demos/platformer_3d-rapier | https://idanarye.github.io/bevy-tnua/demos/platformer_3d-xpbd |

### Running the Demos Locally

```sh
$ cargo run --example <demo-name> --features <physics-backend>
$ cargo run --bin <demo-name> --features <physics-backend>
```

Where `<demo-name>` is the name of the demo and `<physics-backend>` is either `rapier2d`, `rapier3d`, `xpbd2d` or `xpbd3d`. Make sure to match the dimensionality of the backend (2D or 3D) to that of the example. For example, to run the 3D platformer with XPBD, use this:
Where `<demo-name>` is the name of the demo and `<physics-backend>` is either `rapier2d`, `rapier3d`, `xpbd2d` or `xpbd3d`. Make sure to match the dimensionality of the backend (2D or 3D) to that of the demo. For example, to run the 3D platformer with XPBD, use this:

```sh
$ cargo run --example platformer_3d --features xpbd3d
$ cargo run --bin platformer_3d --features xpbd3d
```

### Interesting Parts of the Demo Code

* Check out [the demos' entry points](demos/examples/) to see how the plugins and the player character entities are being set.
* Check out [the demos' entry points](demos/src/bin/) to see how the plugins and the player character entities are being set.
* Check out [the character control systems](demos/src/character_control_systems/) to see how to control the character's motion and special movement actions.
* Check out [the character animating systems](demos/src/character_animating_systems/) to see how to use information from Tnua for character animation.

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 4e81032

Please sign in to comment.