I made a mario-esque side scrolling game, or at least I got that feature working which was all I was trying to do. Essentially, I just had two sets of coordinates, each to mark when the player should be locked to the camera, or free. When it was locked to the camera, I had the character stand still while the world moved around him, and when they turned the other way, it would unlock and the character would move himself until colliding with the coordinate on the opposite side, which locked to the camera in the other direction.
I also attempted this idea before the above, but it was a bit clunky. The idea was to make the camera seem detached from the character all together, and having it pan in his direction, but not particularly at the same speed. The further you distanced yourself from the center point, the faster the camera would move, therefor you couldn't actually outrun the camera. I could never get the right ratio for distance:speed of world. Not only that, but the world moving at the same time as the character moving would create problems with my collision detection, and I could never fully get over it, it always looked broken, and would fail often(though I admit that's probably my bad, the method I used had worked in the past flawlessly with a fixed sidescrolling camera). The last problem I had was that the graphic I used as the background would very very slowly move, and it would eventually be out of sync with the coordinates that allocate the hitboxes(probably my fault too but it was weird as hell).
That's all I got, good luck to you. If you just want a fixed side scrolling camera then ignore everything I just said and simply have the character stand in one place, and move the area around him instead of the character himself.