I don’t believe that’s quite what the OP is trying to get at. In a platformer, your character, and the base platform, may lie near the bottom the screen, not the centre, and that may have to change as your character starts moving vertically.
I don’t have any experience designing a system like this, and there’s certainly no one answer, but these are some things I’d probably keep in mind:
-
Make sure the view of the camera does not go outside the bounds of where you want the player to see. This provides a solid edge for your camera to clamp to. e.g. clamp bottom of camera to base platform when at the bottom. I’d probably unclamp it once the player moves half way back across the view.
-
Consider the current vector of the players movement. If a player is falling, they will need more view space at the bottom of the screen so they can react to oncoming objects. This is the same for every direction, and possibly proportional with speed.
-
If your player is not at any edges of the playable area, then I’d probably keep him centered, as this gives the player equal visibility in every direction.
-
You could use the camera to guide the player. e.g. if in your level, you have a big vertical hole in the ground that the player must jump in to, you could move the camera so the player is at the top of the screen, and the hole takes up the rest of the screen. This indicates to the player that it’s the only way to go.
Camera damping is something you could do that you may or may not want. Ultimately it’s all about the experience you want to provide in your game. I would guess that players want to see as much as they can in the direction they want to go, so perhaps do your best to cater for that.