Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions content/learn/quick-start/getting-started/ecs.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ We can then add people to our [`World`] using a "startup system". Startup system

{{file_code_block(file="quick-start/getting_started_v3.rs", anchor="add_people_system")}}

Now register the startup system like this:
Now register the startup system. Note that you can pass more than one system into an `add_systems` call by using a tuple!

{{file_code_block(file="quick-start/getting_started_v3.rs", anchor="app_main")}}

Expand All @@ -84,7 +84,7 @@ The parameters we pass into a "system function" define what data the system runs

You can interpret the [`Query`] above as: "iterate over every `Name` component for entities that also have a `Person` component".

Now we just register the system in our `App`. Note that you can pass more than one system into an `add_systems` call by using a tuple!
Now we just register the system in our `App`.

[`Query`]: <https://docs.rs/bevy/latest/bevy/ecs/system/struct.Query.html>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ fn hello_world() {

// ANCHOR: app_main
fn main() {
App::new().add_systems(Update, hello_world).run();
App::new().add_systems(Startup, hello_world).run();
}
// ANCHOR_END: app_main
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ fn hello_world() {
// ANCHOR: app_main
fn main() {
App::new()
.add_systems(Startup, add_people)
.add_systems(Update, hello_world)
.add_systems(Startup, (hello_world, add_people))
.run();
}
// ANCHOR_END: app_main
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ fn hello_world() {
// ANCHOR: app_main
fn main() {
App::new()
.add_systems(Startup, add_people)
.add_systems(Update, (hello_world, greet_people))
.add_systems(Startup, (hello_world, add_people))
.add_systems(Update, greet_people)
.run();
}
// ANCHOR_END: app_main
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ fn hello_world() {
// ANCHOR: app_main
fn main() {
App::new()
.add_systems(Startup, add_people)
.add_systems(Update, (hello_world, (update_people, greet_people).chain()))
.add_systems(Startup, (hello_world, add_people))
.add_systems(Update, (update_people, greet_people).chain())
.run();
}
// ANCHOR_END: app_main
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ fn hello_world() {
fn main() {
App::new()
.add_plugins(DefaultPlugins)
.add_systems(Startup, add_people)
.add_systems(Update, (hello_world, (update_people, greet_people).chain()))
.add_systems(Startup, (hello_world, add_people))
.add_systems(Update, (update_people, greet_people).chain())
.run();
}
// ANCHOR_END: app_main
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ fn main() {
App::new()
.add_plugins(DefaultPlugins)
.add_plugins(HelloPlugin)
.add_systems(Startup, add_people)
.add_systems(Update, (hello_world, (update_people, greet_people).chain()))
.add_systems(Startup, (hello_world, add_people))
.add_systems(Update, (update_people, greet_people).chain())
.run();
}
// ANCHOR_END: app_main
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ pub struct HelloPlugin;
// ANCHOR: hello_plugin_implementation
impl Plugin for HelloPlugin {
fn build(&self, app: &mut App) {
app.add_systems(Startup, add_people);
app.add_systems(Update, (hello_world, (update_people, greet_people).chain()));
app.add_systems(Startup, (hello_world, add_people));
app.add_systems(Update, (update_people, greet_people).chain());
}
}

Expand Down