player and physics plygins
This commit is contained in:
21
src/main.rs
21
src/main.rs
@@ -1,26 +1,19 @@
|
||||
use asset_loading::ImageAssets;
|
||||
use bevy::{prelude::*, state::app::StatesPlugin};
|
||||
use bevy::prelude::*;
|
||||
use player_plugin::PlayerPlugin;
|
||||
use physics_plugin::PhysicsPlugin;
|
||||
|
||||
mod asset_loading;
|
||||
|
||||
pub mod player;
|
||||
mod player_plugin;
|
||||
mod physics_plugin;
|
||||
|
||||
fn main() {
|
||||
App::new()
|
||||
.add_plugins((DefaultPlugins, asset_loading::plugin))
|
||||
.add_plugins((DefaultPlugins, asset_loading::plugin, PlayerPlugin, PhysicsPlugin))
|
||||
.init_state::<GameState>()
|
||||
// We need to register components to make them visible to Blenvy
|
||||
.add_systems(Startup, setup)
|
||||
.add_systems(OnExit(GameState::Loading), debug_our_king)
|
||||
.add_systems(Startup, (setup, player::init_player))
|
||||
.add_systems(Update, player::move_camera)
|
||||
.add_systems(FixedUpdate, player::advance_physics)
|
||||
.add_systems(
|
||||
RunFixedMainLoop,
|
||||
(
|
||||
player::handle_input.in_set(RunFixedMainLoopSystem::BeforeFixedMainLoop),
|
||||
player::interpolate_rendered_transform.in_set(RunFixedMainLoopSystem::AfterFixedMainLoop),
|
||||
),
|
||||
)
|
||||
.run();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user