Made NPC movement smoother

Former-commit-id: 105908cf0118113408acd5ad7dce191fe405f88f
This commit is contained in:
Joshua Barretto 2019-04-21 19:26:08 +01:00
parent 1df7d0080f
commit 247ba6621a

View File

@ -22,7 +22,7 @@ impl<'a> System<'a> for Sys {
*bearing += Vec2::new(
rand::random::<f32>().fract() - 0.5,
rand::random::<f32>().fract() - 0.5,
) - *bearing * 0.05 - pos.0 * 0.001;
) * 0.1 - *bearing * 0.01 - pos.0 * 0.0002;
if bearing.magnitude_squared() != 0.0 {
control.move_dir = bearing.normalized();