animation
Making shapes appear to move by redrawing them in slightly different places many times a second.
In more detail
In graphics.py an animation loop moves each shape a small step, then sleeps a short time with time.sleep. Small jumps and a short delay look smooth; big jumps look jerky.
Related terms
- move() — The graphics.py method that shifts a drawn shape by dx pixels across and dy pixels down.
- time.sleep — A function in the time module that pauses the program for a given number of seconds, which may be a fraction.
- autoflush — A GraphWin setting that controls whether the screen redraws after every change or only when you call update().
Taught in
- A Graphics Introduction — Hands-on Python: Complete Video Course & Book
- Reading The graphics.py Documentation — Hands-on Python: Complete Video Course & Book
- Animation: Moving One Shape — Hands-on Python: Complete Video Course & Book
- Animation: Loops, Bouncing, Flushing — Hands-on Python: Complete Video Course & Book
- Graphical Applications With While — Hands-on Python: Complete Video Course & Book