use bevy::prelude::*; use grid_plane::GridPlanePlugin; fn main() { App::new() .insert_resource(ClearColor(Color::BLACK)) .add_plugins(DefaultPlugins) .add_plugin(GridPlanePlugin::default()) .add_startup_system(setup) .add_system(camera_controls) .run(); } fn setup( mut commands: Commands, mut meshes: ResMut>, mut materials: ResMut>, ) { // add the cube commands.spawn(PbrBundle { mesh: meshes.add(shape::Box::new(1.0, 1.0, 1.0).into()), material: materials.add(Color::SEA_GREEN.into()), ..default() }); // add the camera commands.spawn(Camera3dBundle { transform: Transform::from_xyz(0.0, 8., 12.0).looking_at(Vec3::new(0., 1., 0.), Vec3::Y), ..default() }); } pub fn camera_controls( keyboard: Res>, mut camera_query: Query<&mut Transform, With>, time: Res