Compare commits

..

No commits in common. "0803b9d61194598fdbb54a023596bf3d12557745" and "d9a88964444b83472f8974171347a2cd85151e07" have entirely different histories.

1 changed files with 5 additions and 5 deletions

View File

@ -25,10 +25,10 @@ struct BoidBundle {
boid: Boid,
}
fn move_boids(mut boids: Query<(&mut Transform, &Velocity), With<Boid>>, time: Res<Time>) {
for (mut transform, velocity) in &mut boids {
transform.translation += velocity.0 * time.delta_seconds();
}
fn move_boids(mut boids: Query<(&mut Transform, &Velocity), With<Boid>>) {
boids.iter_mut().for_each(|(mut transform, velocity)| {
transform.translation += velocity.0;
});
}
fn setup(
@ -47,7 +47,7 @@ fn setup(
transform: Transform::from_scale(Vec3::splat(2.5)),
..default()
},
velocity: Velocity(Vec3::Y * 25.),
velocity: Velocity(Vec3::Y),
..default()
});
}