player += physics
This commit is contained in:
parent
1bf852aff4
commit
5b8bd5c525
1 changed files with 6 additions and 1 deletions
|
@ -2,7 +2,7 @@ use bevy::prelude::*;
|
||||||
|
|
||||||
use bevy_rapier2d::prelude::*;
|
use bevy_rapier2d::prelude::*;
|
||||||
|
|
||||||
use crate::AppState;
|
use crate::{AppState, METER};
|
||||||
|
|
||||||
use super::set::IngameSet;
|
use super::set::IngameSet;
|
||||||
#[derive(Component)]
|
#[derive(Component)]
|
||||||
|
@ -15,5 +15,10 @@ pub(super) fn player_plugin(app: &mut App) {
|
||||||
pub fn add_player(mut commands: Commands) {
|
pub fn add_player(mut commands: Commands) {
|
||||||
commands
|
commands
|
||||||
.spawn(Player {})
|
.spawn(Player {})
|
||||||
|
.insert((
|
||||||
|
RigidBody::Dynamic,
|
||||||
|
Collider::cuboid(0.4 * METER, 0.9 * METER),
|
||||||
|
Velocity::default(),
|
||||||
|
))
|
||||||
.insert(ActiveEvents::COLLISION_EVENTS);
|
.insert(ActiveEvents::COLLISION_EVENTS);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue