cyber_rider/src/main.rs
Joe Ardent 37e8e40c3f Move collider setup to separate file and plugin.
Just make more room in the actions file for fancier dynamic stuff.
2022-02-25 14:53:00 -08:00

43 lines
1.3 KiB
Rust

use bevy::prelude::*;
use cyber_rider::{
action::{CyberActionPlugin, MovementSettings},
camera::CyberCamPlugin,
colliders::CyberCollidersPlugin,
disable_mouse_trap,
geometry::CyberGeomPlugin,
glamor::CyberGlamorPlugin,
input::CyberInputPlugin,
lights::CyberSpaceLightsPlugin,
ui::CyberUIPlugin,
};
const MOVEMENT_SETTINGS: MovementSettings = MovementSettings {
sensitivity: 10.0, // steering
accel: 30.0, // thrust
gravity: 8.0,
};
fn main() {
let mut app = App::new();
app.insert_resource(Msaa { samples: 4 })
.insert_resource(ClearColor(Color::rgb(0.07, 0.001, 0.02)))
.insert_resource(WindowDescriptor {
width: 2560.0,
height: 1440.0,
..Default::default()
})
.insert_resource(MOVEMENT_SETTINGS)
.add_plugins(DefaultPlugins)
.add_plugin(CyberGeomPlugin)
.add_plugin(CyberGlamorPlugin)
.add_plugin(CyberInputPlugin)
.add_plugin(CyberActionPlugin)
.add_plugin(CyberCamPlugin)
.add_plugin(CyberSpaceLightsPlugin)
.add_plugin(CyberUIPlugin)
.add_plugin(CyberCollidersPlugin)
.add_startup_system(disable_mouse_trap)
.add_system(bevy::input::system::exit_on_esc_system);
app.run();
}