usingMaths.com
Demonstrating and showing pupils and students one application of Mathematics.







<< PreviousNext >>

Code to Animate a Body (Circle) Across the Canvas Component in Python



How to Draw on the Turtle Canvas

We'll will draw a circle - our body - using the turtle.circle() method of the Turtle object.



Animating a Body

To make the circle appear to move across the canvas, i.e., animate the circle, we'll simply draw the circle repeatedly, changing its position progressively.
Since the ball (circle) is the turtle itself, it does not any clearing since it does not leave any traces.

Create 2 new files; File, New File.
Call them Facet.py and MovingBody.py.
Type out the adjoining Python / Turtle code for animating an image body across the canvas component.



Note: The code module for our Facet class will remain the same for the rest of the demonstrations in this category.
Hence it will be left out hence forth.

Important: When trying to click on the button to get things started, you might need to click away from the button text.










<< PreviousNext >>