cyber_rider/src/main.rs

44 lines
1.3 KiB
Rust
Raw Normal View History

2021-11-06 05:32:55 +00:00
use bevy::prelude::*;
use cyber_rider::{
action::{CyberActionPlugin, MovementSettings},
camera::CyberCamPlugin,
bike::CyberCollidersPlugin,
disable_mouse_trap,
planet::CyberGeomPlugin,
2022-01-14 06:05:51 +00:00
glamor::CyberGlamorPlugin,
input::CyberInputPlugin,
lights::CyberSpaceLightsPlugin,
ui::CyberUIPlugin,
};
const MOVEMENT_SETTINGS: MovementSettings = MovementSettings {
sensitivity: 10.0, // steering
accel: 30.0, // thrust
gravity: 8.0,
};
2021-11-06 05:32:55 +00:00
fn main() {
2022-01-14 06:05:51 +00:00
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()
})
2022-02-22 01:04:46 +00:00
.insert_resource(MOVEMENT_SETTINGS)
2021-11-06 05:32:55 +00:00
.add_plugins(DefaultPlugins)
.add_plugin(CyberGeomPlugin)
2022-01-14 06:05:51 +00:00
.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)
2022-01-14 06:05:51 +00:00
.add_system(bevy::input::system::exit_on_esc_system);
app.run();
2021-11-06 05:32:55 +00:00
}