A multiplayer VR framework w/voice chat
1use bevy::{DefaultPlugins, app::{App, FixedUpdate, Startup, Update}, ecs::system::Commands}; 2use felix_audio::{FelixAudio, voice}; 3 4use crate::{components::{debug_camera, network_interface, remote_player}, setup::setup}; 5 6mod components; 7mod setup; 8mod net; 9 10fn main() { 11 if let Err(err) = dotenvy::dotenv(){ println!("[WARN] .ENV failed loading {:#?}", err); } 12 13 App::new() 14 .add_plugins(( 15 DefaultPlugins, 16 FelixAudio 17 )) 18 .add_systems(Startup, setup) 19 .add_systems(Startup, move | mut commands: Commands |{ 20 let ( comp, voice ) = net::handle_net().expect("Network Module Failed"); 21 commands.spawn(comp); 22 23 match voice::init_microphone(voice){ 24 Ok(voice) => { commands.spawn(voice); }, 25 Err(err) => println!("[WARN] Failed to start microphone: {}", err) 26 } 27 }) 28 .add_systems(Update, debug_camera::update) 29 .add_systems(Startup, debug_camera::setup) 30 .add_systems(Update, remote_player::update) 31 .add_systems(FixedUpdate, network_interface::fixed_update) 32 .run(); 33}