We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b487fac commit 0bfc94eCopy full SHA for 0bfc94e
src/main.rs
@@ -25,10 +25,17 @@ fn spawn_snake(mut commands: Commands) {
25
.insert(SnakeHead);
26
}
27
28
+fn snake_movement(mut head_positions: Query<(&SnakeHead, &mut Transform)>) {
29
+ for (_head, mut transform) in head_positions.iter_mut() {
30
+ transform.translation.y += 2.;
31
+ }
32
+}
33
+
34
fn main() {
35
App::new()
36
.add_startup_system(setup_camera)
37
.add_startup_system(spawn_snake)
38
+ .add_system(snake_movement)
39
.add_plugins(DefaultPlugins)
40
.run();
41
0 commit comments