Fixed player speed

Former-commit-id: becc175a91cd60a8957baa8eaaab35f740f677ed
This commit is contained in:
Joshua Barretto 2019-04-12 23:20:08 +01:00
parent 51f7d85508
commit 276d5359cd

View File

@ -153,7 +153,7 @@ impl Client {
// TODO: remove this // TODO: remove this
const PLAYER_VELOCITY: f32 = 100.0; const PLAYER_VELOCITY: f32 = 100.0;
// TODO: Set acceleration instead // TODO: Set acceleration instead
self.state.write_component(ecs_entity, comp::phys::Vel(Vec3::from(input.move_dir * PLAYER_VELOCITY))); self.state.write_component(ecs_entity, comp::phys::Vel(Vec3::from(input.move_dir * PLAYER_VELOCITY) * 0.1));
if input.move_dir.magnitude() > 0.01 { if input.move_dir.magnitude() > 0.01 {
self.state.write_component(ecs_entity, comp::phys::Dir(input.move_dir.normalized().into())); self.state.write_component(ecs_entity, comp::phys::Dir(input.move_dir.normalized().into()));
} }