player += physics

This commit is contained in:
TudbuT 2024-11-22 22:55:45 +01:00
parent 1bf852aff4
commit 5b8bd5c525
No known key found for this signature in database
GPG key ID: B3CF345217F202D3

View file

@ -2,7 +2,7 @@ use bevy::prelude::*;
use bevy_rapier2d::prelude::*;
use crate::AppState;
use crate::{AppState, METER};
use super::set::IngameSet;
#[derive(Component)]
@ -15,5 +15,10 @@ pub(super) fn player_plugin(app: &mut App) {
pub fn add_player(mut commands: Commands) {
commands
.spawn(Player {})
.insert((
RigidBody::Dynamic,
Collider::cuboid(0.4 * METER, 0.9 * METER),
Velocity::default(),
))
.insert(ActiveEvents::COLLISION_EVENTS);
}