Controlling ship movements with device motion