generated from 2ndbeam/bevy-template
feat: Basic player implementation
This commit is contained in:
parent
62199a1817
commit
e4b1475c48
9 changed files with 830 additions and 54 deletions
25
src/plugin.rs
Normal file
25
src/plugin.rs
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
//! 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);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue