generated from 2ndbeam/bevy-template
25 lines
727 B
Rust
25 lines
727 B
Rust
//! Plugin module where everything is connected
|
|
|
|
use bevy::prelude::*;
|
|
use bevy_rapier2d::prelude::*;
|
|
use leafwing_input_manager::prelude::*;
|
|
|
|
use crate::*;
|
|
|
|
/// Plugin that connects everything needed for this prototype
|
|
pub struct GamePlugin;
|
|
|
|
impl Plugin for GamePlugin {
|
|
fn build(&self, app: &mut App) {
|
|
app.add_plugins((
|
|
RapierDebugRenderPlugin::default(),
|
|
RapierPhysicsPlugin::<()>::default()
|
|
.with_length_unit(meters(1.)),
|
|
|
|
InputManagerPlugin::<input::PlayerInput>::default(),
|
|
InputManagerPlugin::<input::DebugInput>::default(),
|
|
))
|
|
.add_systems(Startup, setup)
|
|
.add_systems(Update, player::systems::handle_input);
|
|
}
|
|
}
|