Skip to content

Commit

Permalink
wording
Browse files Browse the repository at this point in the history
  • Loading branch information
mockersf committed Oct 29, 2024
1 parent c578e96 commit 99c643d
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 3 deletions.
3 changes: 3 additions & 0 deletions bevy-workshop/src/basics/display.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,12 @@ fn display_level(mut commands: Commands) {
));
}
```
<div class="warning">

Don't forget to add the new `GamePlugin` to the app in the `main.rs` file.

</div>

## Tag Components

Helper component to query for specific entities.
2 changes: 1 addition & 1 deletion bevy-workshop/src/basics/progress.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* reading the [`ButtonInput<T>`](https://docs.rs/bevy/0.15.0-rc.2/bevy/input/struct.ButtonInput.html) resource
* for the input [`KeyCode`](https://docs.rs/bevy/0.15.0-rc.2/bevy/input/keyboard/enum.KeyCode.html)
* Writing more complex queries, and updating components
* the [`With`](https://docs.rs/bevy/0.15.0-rc.2/bevy/ecs/prelude/struct.With.html) query filter
* the [`With`](https://docs.rs/bevy/0.15.0-rc.2/bevy/ecs/prelude/struct.With.html) and [`Without`](https://docs.rs/bevy/0.15.0-rc.2/bevy/ecs/prelude/struct.Without.html) query filters
* and using [`&mut`](https://docs.rs/bevy/0.15.0-rc.2/bevy/ecs/change_detection/struct.Mut.html) to query data mutably

## Going Further
Expand Down
2 changes: 1 addition & 1 deletion bevy-workshop/src/intro/plugins.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ fn main() {
}))
.init_state::<GameState>()
.enable_state_scoped_entities::<GameState>()
.add_plugins(splash::SplashPlugin)
.add_plugins(splash::SplashPlugin) // adding our new plugin
.run();
}
Expand Down
1 change: 1 addition & 0 deletions bevy-workshop/src/intro/systems.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ fn main() {
}),
..default()
}))
// adding a system executed once on startup
.add_systems(Startup, display_title)
.run();
}
Expand Down
8 changes: 7 additions & 1 deletion bevy-workshop/src/intro/updating.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,18 @@ fn remove_title(

Used to store singleton in the world, based on their type. See [`Resource`](https://docs.rs/bevy/0.15.0-rc.2/bevy/ecs/prelude/trait.Resource.html).

Here we're adding a resource `SplashScreenTimer` that will just hold a `Timer`.

## Queries

Used to access entities and their components in the world. Can be filtered. See [`Query`](https://docs.rs/bevy/0.15.0-rc.2/bevy/ecs/prelude/struct.Query.html).

In the `remove_title` system, we're using a `Query` that only request access to the [`Entity`](https://docs.rs/bevy/0.15.0-rc.2/bevy/ecs/entity/struct.Entity.html), filtering on the component [`Node`](https://docs.rs/bevy/0.15.0-rc.2/bevy/prelude/struct.Node.html) which is a basic component shared between all elements in the UI.

## Mutable VS Immutable Access

The `remove_title` example access two resources, `Time` in a non mutable way, and `SplashScreenTimer` in a mutable way.
The `remove_title` system accesses two resources:
* [`Time`](https://docs.rs/bevy/0.15.0-rc.2/bevy/prelude/struct.Time.html), provided by Bevy, in a immutable way
* `SplashScreenTimer`, our custom resource, in a mutable way; The timer in this resource will be ticked, so we need to be able to modify it

As the world continue to hold ownership of data, systems have access to references. Only one system accessing a given part of the world mutably can run at a single time. Systems that access different part mutable, or the same part immutably can run in parallel.

0 comments on commit 99c643d

Please sign in to comment.