From 3f587d6b1d558b11e1249d60328261cb939c9e91 Mon Sep 17 00:00:00 2001 From: Martin Kruger <12804622+crener@users.noreply.github.com> Date: Sat, 6 Nov 2021 23:41:16 +0000 Subject: [PATCH 1/2] Fixed ECS example compilation issues If you paste the old 'Using Bevy ECS' sample code and try to compile it you will get error messages - system() is not being called for the movement system in the scheduler - The movement systems Query is not mutableable which the rust compiler doesn't like This small commit fixes that so that new users don't have this issue when trying to lean from the samples. --- crates/bevy_ecs/README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/bevy_ecs/README.md b/crates/bevy_ecs/README.md index 8bdb28fa59cd4..fa5275e42b15e 100644 --- a/crates/bevy_ecs/README.md +++ b/crates/bevy_ecs/README.md @@ -96,7 +96,7 @@ The built in "parallel stage" considers dependencies between systems and (by def Bevy ECS should feel very natural for those familiar with Rust syntax: ```rust -use bevy_ecs::prelude::*; +use bevy::prelude::*; struct Velocity { x: f32, @@ -109,7 +109,7 @@ struct Position { } // This system moves each entity with a Position and Velocity component -fn movement(query: Query<(&mut Position, &Velocity)>) { +fn movement(mut query: Query<(&mut Position, &Velocity)>) { for (mut position, velocity) in query.iter_mut() { position.x += velocity.x; position.y += velocity.y; @@ -131,7 +131,7 @@ fn main() { // Add a Stage to our schedule. Each Stage in a schedule runs all of its systems // before moving on to the next Stage schedule.add_stage("update", SystemStage::parallel() - .with_system(movement) + .with_system(movement.system()) ); // Run the schedule once. If your app has a "loop", you would run this once per loop From 605c5e0c2001225d830c92442d08de0e6ee1a99c Mon Sep 17 00:00:00 2001 From: Martin Kruger <12804622+crener@users.noreply.github.com> Date: Sat, 6 Nov 2021 23:49:05 +0000 Subject: [PATCH 2/2] Undid ECS 'use' format change Noticed that I accidentally changed the use format from 'bevy_ecs' to 'bevy' which seems to be the standard for the crate examples, So reverted that change. --- crates/bevy_ecs/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/bevy_ecs/README.md b/crates/bevy_ecs/README.md index fa5275e42b15e..a79494e381947 100644 --- a/crates/bevy_ecs/README.md +++ b/crates/bevy_ecs/README.md @@ -96,7 +96,7 @@ The built in "parallel stage" considers dependencies between systems and (by def Bevy ECS should feel very natural for those familiar with Rust syntax: ```rust -use bevy::prelude::*; +use bevy_ecs::prelude::*; struct Velocity { x: f32,