Game Programming using Qt 5 Beginner's Guide - Second Edition
by Pavel Strakhov, Witold Wysota, Lorenz Haas
Composing animations
The animation we made in the last section looks OK but is not very realistic. The sun should rise in the morning, reach its peak sometime before noon, and then, sometime later, start setting toward the evening, when it should cross the horizon and hide beneath the landscape.
To achieve such an effect, we can add two more animations for the y property of the sun. The first animation would start right at the beginning and decrease the vertical position of the sun (remember that the vertical geometry axis points down, so decreasing the vertical position means the object goes up). The animation would be complete at one-third of the day length. We would then need a way to wait for some time and then start a second animation ...
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