June 2021
Beginner
432 pages
9h 9m
English
This visualization program has a rough physics engine that simulates sand falling through the small aperture of an hourglass. The sand piles up in the bottom half of the hourglass; then the hourglass is turned over so the process repeats.
Figure 36-1 shows what the output will look like when you run hourglass.py.
Figure 36-1: The output of the hourglass program with sand falling
The hourglass program implements a rudimentary physics engine. A physics engine is software that simulates physical ...
Read now
Unlock full access