Fix glitchyness when moving and pausing the game