Moving the snake

This commit is contained in:
Timothy Warren 2020-12-24 13:45:07 -05:00
parent e623fb6553
commit e860af1d7a

View File

@ -22,10 +22,17 @@ fn spawn_snake(commands: &mut Commands, materials: Res<Materials>) {
.with(SnakeHead);
}
fn snake_movement(mut head_positions: Query<(&SnakeHead, &mut Transform)>) {
for (_head, mut transform) in head_positions.iter_mut() {
transform.translation.y += 2.;
}
}
fn main() {
App::build()
.add_startup_system(setup.system())
.add_startup_stage("game_setup", SystemStage::single(spawn_snake.system()))
.add_system(snake_movement.system())
.add_plugins(DefaultPlugins)
.run();
}