Game Programming using Qt 5 Beginner's Guide - Second Edition
by Pavel Strakhov, Witold Wysota, Lorenz Haas
What just happened?
Our animation has a lot of properties because it should be flexible enough to handle all the cases we need. First, it should be able to animate any disk, so we added the target property that will contain the disk we currently move. Next, the rods that participate in the movement influence the intermediate and final coordinates of the disk (more specifically, its x and z coordinates). The rod1Pos and rod2Pos properties will hold the coordinates of the rods in play. The startY and finalY properties define the starting and final coordinates of the disk. These coordinates will depend on the current number of disks stored on each rod. Finally, the maxY property simply defines the maximum height the disk will raise at while ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access