April 2018
Beginner
714 pages
18h 21m
English
We already discussed the useful technique of parallax scrolling in Chapter 6, Qt Core Essentials. It gives the impression of depth for 2D games by moving multiple layers of background at a different speed depending on the assumed distance of the layer from the viewer. Let's see how easy it is to apply the same technique in Qt Quick.
We will implement parallax scrolling with a set of layers that move in the direction opposite to the one the player is moving in. Therefore, we will need a definition of the scene and a moving layer.
Create a new QML File (Qt Quick 2). Call it ParallaxScene.qml. The scene will encompass the whole game "level" and will expose the position of the player to the moving ...
Read now
Unlock full access