Parallax Scrolling
Depth through motion
Parallax scrolling moved background layers at different speeds to create an illusion of depth, transforming flat 2D games into seemingly three-dimensional spaces.
Overview
Parallax scrolling exploits a simple perceptual truth: distant objects appear to move more slowly than near ones. By scrolling multiple background layers at different speeds, games created convincing depth on hardware that could only display flat 2D graphics. Moon Patrol pioneered the technique in 1982; by the 16-bit era, games like Sonic the Hedgehog used it as standard.
The principle
Real-world parallax
When you look out of a moving car:
- Nearby trees rush past quickly
- Distant hills move slowly
- The moon appears stationary
Game implementation
| Layer | Scroll speed | Typical content |
|---|---|---|
| Foreground | 1:1 with player | Platforms, obstacles |
| Middle | 1:2 | Trees, buildings |
| Background | 1:4 | Mountains, clouds |
| Far background | 1:8 or static | Sky, horizon |
Implementation approaches
Software scrolling
Redraw each layer at its speed:
update_parallax:
scroll_layer_0(player_x)
scroll_layer_1(player_x / 2)
scroll_layer_2(player_x / 4)
Hardware scrolling
Some systems supported multiple scroll registers:
- SNES: Modes 0/1 give 3-4 background layers, each with its own scroll registers — the standard way to do parallax on SNES. Mode 7 is a separate, single rotated/scaled background; not multi-layer in itself, but can be combined with one extra normal layer.
- Mega Drive: Two scroll planes (A, B) plus a fixed Window plane for HUDs.
- Amiga: Dual playfield mode renders two independent layers from the bitplanes, each with its own scroll value via BPLCON1.
Colour cycling tricks
On limited hardware, animate palette entries to simulate motion without actually scrolling data.
Platform specifics
Commodore 64
- Single hardware scroll register
- Software-based layer rendering
- VSP (Variable Screen Position) tricks
- Character-based scrolling efficient
Amiga
- Dual playfield mode enables two independent layers
- Copper can change scroll values mid-screen
- Blitter enables fast layer compositing
NES
- Single background layer (nametable)
- Parallax via CHR bank switching
- Sprite-based parallax for extra layers
- Scanline tricks for fake layers
Mega Drive
- Two background planes (A and B)
- Per-line scroll values via the H-scroll table in VRAM (different scroll per scanline = arbitrary layer counts)
- Window plane for HUD
Per-platform parallax tricks
- Sega Master System (Sonic 1, 1991): the SMS has a single nametable. Sonic gets parallax by swapping CHR pattern table banks mid-frame using the VDP's H-counter interrupt — different tile data appears on different scanlines, faking layer separation.
- Amiga (Shadow of the Beast, 1989): uses the Copper to rewrite BPLxPT (bitplane pointers) every scanline, effectively giving each scanline its own scroll position. With careful palette and bitplane assignment this produced the famous 12+ layers of parallax — far beyond what the dual-playfield hardware alone supports.
- NES (Battletoads, Mega Man series): uses MMC3 scanline IRQ to reload
$2005scroll values mid-frame, giving 2-3 effective layers from a single nametable. - C64 (Mayhem in Monsterland): uses VSP ($D016 mid-line writes) plus careful character-cell design to give multi-speed scroll without redrawing data.
Performance considerations
| Approach | CPU cost | Memory cost |
|---|---|---|
| Single layer | Low | Low |
| Software multi-layer | High | Medium |
| Hardware multi-layer | Low | High |
| Colour cycling | Very low | Very low |
Notable examples
| Game | Year | Layers |
|---|---|---|
| Moon Patrol | 1982 | 3 |
| Shadow of the Beast | 1989 | 13 |
| Sonic the Hedgehog | 1991 | 4+ |
| Castlevania: Rondo | 1993 | Multiple |
Modern use
Parallax remains common:
- 2D indie games
- Website design (CSS parallax)
- Mobile games
- Retro-styled titles