use bevy::prelude::*; use bevy_mod_picking::*; mod pieces; use pieces::*; mod board; use board::*; fn main() { App::build() // antialiasing at 4 samples .insert_resource(Msaa { samples: 4}) // change title and size of window .insert_resource(WindowDescriptor { title: "Chess!".to_string(), width: 1600.0, height: 1000.0, ..Default::default() }) .add_plugins(DefaultPlugins) .add_plugin(PickingPlugin) .add_plugin(BoardPlugin) .add_startup_system(setup.system()) .add_startup_system(create_pieces.system()) .run(); } fn setup( mut commands: Commands, mut meshes: ResMut>, mut materials: ResMut>, ) { // Camera commands.spawn_bundle(PerspectiveCameraBundle { transform: Transform::from_matrix(Mat4::from_rotation_translation( Quat::from_xyzw(-0.3, -0.5, -0.3, 0.5).normalize(), Vec3::new(-7.0, 20.0, 4.0), )), ..Default::default() }) .insert_bundle(PickingCameraBundle::default()); // Light commands.spawn_bundle(LightBundle { transform: Transform::from_translation(Vec3::new(4.0, 8.0, 4.0)), ..Default::default() }); }