player: tune movement

This commit is contained in:
Astro 2022-01-15 02:31:58 +01:00
parent c565692e63
commit fd3a82f475
1 changed files with 5 additions and 4 deletions

View File

@ -54,7 +54,7 @@ pub fn spawn_player(
}) })
.insert(PhysicMaterial { .insert(PhysicMaterial {
restitution: 0.0, restitution: 0.0,
density: 12.0, density: 20.0,
friction: 1.0, friction: 1.0,
}) })
.insert(RotationConstraints::lock()) .insert(RotationConstraints::lock())
@ -97,7 +97,8 @@ pub fn input(
input: Res<InputState>, input: Res<InputState>,
mut players: Query<(&mut Velocity, &mut Player, &mut Transform, &GroundContact)> mut players: Query<(&mut Velocity, &mut Player, &mut Transform, &GroundContact)>
) { ) {
const SPEED: f32 = 3.0; const SPEED: f32 = 4.0;
for (mut velocity, mut player, mut transform, contact) in players.iter_mut() { for (mut velocity, mut player, mut transform, contact) in players.iter_mut() {
let x; let x;
let z; let z;
@ -151,10 +152,10 @@ pub fn input(
} }
let y = if input.0.contains(&(player.input_source.clone(), Key::Jump)) { let y = if input.0.contains(&(player.input_source.clone(), Key::Jump)) {
1.4 1.2
} else if x != 0.0 || z != 0.0 { } else if x != 0.0 || z != 0.0 {
// walk bobbing // walk bobbing
0.4 0.2
} else { } else {
0.0 0.0
}; };