Game Programming using Qt 5 Beginner's Guide
上QQ阅读APP看书,第一时间看更新

Parallax scrolling

Parallax scrolling is a trick to add an illusion of depth to the background of the game. This illusion occurs when the background has different layers that move at different speeds. The nearest background must move faster than the ones farther away. In our case, we have these four backgrounds ordered from the most distant to the nearest:

The sky:

The trees:

The grass:

The ground: