O'Reilly logo

Game Programming using Qt 5 Beginner's Guide - Second Edition by Lorenz Haas, Witold Wysota, Pavel Strakhov

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required