← THE BLUE STICK

Guides / Game mechanics explained

How 2D Game Cameras Follow the Player

PLAY NOWSolo, free, in your browser

In a 2D game the camera decides how much of the level you can see and where your character sits in the frame. It seems simple: keep the hero in the middle. In practice, a camera locked to the centre makes a game harder to play and unpleasant to watch, and nearly every side-scroller since the 1980s has done something smarter.

The clearest reference on the subject is a 2015 Game Developers Conference talk by Itay Keren, the developer of Mushroom 11, called "Scroll Back: The Theory and Practice of Cameras in Side-Scrollers". It catalogues the techniques below across decades of games.

The problem with centring

If the character is always dead centre, two things go wrong.

The fixes all come down to two ideas: move the camera less often, and when it moves, favour the direction the player is heading.

The parts of a 2D camera

Dead zone and look-ahead in a 2D camera The screen is shown as a rectangle. A smaller dashed box in the left half is the dead zone where the character can move without the camera moving. The character faces right and there is more visible space ahead than behind. what the screen shows dead zone: camera stays still screen centre look-ahead: more room in front less behind danger seen early
The character stands left of centre because they face right. Inside the dashed box they can move freely without the picture shifting at all.
TechniqueWhat it doesWhat it fixes
Dead zoneA box around the character. The camera only moves when the character pushes against its edgeConstant small movements
Look-aheadThe camera shifts in the direction the character faces or movesToo little warning
SmoothingThe camera eases towards its target instead of jumping thereJerky motion
Platform snappingThe camera only moves up or down when the character lands on a new platformThe screen bobbing with every jump
Camera boundsThe camera stops at the edges of the level or roomShowing empty space outside the map
Zoom to fitThe camera pulls back to keep several things in viewLosing sight of a boss or another player

How well-known games use them

Super Mario Bros. (1985) scrolls only forwards. Mario can run in the left part of the screen without moving the camera, and the view advances once he pushes past a point near the middle. The screen never scrolls back, which also stops players returning to earlier parts of a level.

Super Mario World treats vertical movement differently from horizontal. The camera does not follow every jump. It stays level and catches up when Mario lands on a higher platform or climbs far enough, which is platform snapping in practice. It also lets the player nudge the view left or right with the shoulder buttons.

Room-based games such as the original The Legend of Zelda and Celeste avoid the question for much of the time. The camera holds still on one room and moves only when you leave it. A fixed view suits precise platforming because distances on screen never change.

Multiplayer games on one screen, such as the Super Smash Bros. series, zoom and pan to keep every fighter in frame, so the camera pulls out when players separate and tightens when they meet.

What a bad camera costs you

What you can do as a player

  1. Check the options. Many games have settings for camera shake, smoothing or look-ahead. Turning shake down often helps more than any other change if a game makes you queasy.
  2. Face the way you are going. In games with look-ahead, turning around for a moment swings the view away from the danger. Walk backwards as little as possible.
  3. Use the manual look. If a game lets you pan with a stick or a button, use it before blind drops.
  4. Slow down at screen edges. When you are near the leading edge of the view, the camera has run out of look-ahead. Give it a moment to catch up.
  5. Sit back from a big screen. A scrolling 2D view fills more of your vision than a 3D one, so a little distance makes motion easier on the eyes.
PLAY NOWSolo, free, in your browser