Skip to content

Commit

Permalink
Note system_state example on examples/README.md page
Browse files Browse the repository at this point in the history
  • Loading branch information
jkb0o committed Feb 17, 2023
1 parent 33e3ae3 commit 294d571
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
Binary file added docs/system-state.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 11 additions & 1 deletion examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,14 @@ The promise-based loop works like this:
- break loop if yes pressed --------.
- exit app <-------------------------`
```
![Confirmation](../docs/confirmation.gif)
![Confirmation](../docs/confirmation.gif)

### `system_state`
```bash
cargo run --example system_state
```
This example shows how promises keep the state of Bevy's system params.
We create 16 buttons and asyn loop single promise every second.
Inside the promise we log buttons with changed for the previous second
`Interaction` component by querying with Changed<Interaction> filter.
![System State](../docs/system-state.gif)
8 changes: 4 additions & 4 deletions examples/system_state.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//! This example shows how promises keeps the state of Bevy's system params.
//! Here, I create 16 buttons and repeat promise every second.
//! Inside the promise I log buttons with changed for the previous second
//! Interaction component by applying Changed<Interaction> filter to Query.
//! This example shows how promises keep the state of Bevy's system params.
//! We create 16 buttons and asyn loop single promise every second.
//! Inside the promise we log buttons with changed for the previous second
//! `Interaction` component by querying with Changed<Interaction> filter.
use bevy::prelude::*;
use pecs::prelude::*;

Expand Down

0 comments on commit 294d571

Please sign in to comment.