I got program that draws spaceship (Turtle Graphics) forward,backward etc.
By using a lot of orders and lines drawing spaceship takes 5 seconds using turtle.speed(0).
And whenever you click the right/left key it draws it again in other direction. It major thing in my project. Is there a way to draw it faster? Thanks in advance.
By default, turtle has a draw delay of 10 milliseconds. Every time it updates the canvas, it will pause 10 milliseconds as a simple way of controlling the animation speed. This delay is independent of the speed of the turtle itself. If you want to speed up the animation, you can set a shorter delay, e.g. with turtle.delay(3) or turtle.delay(0).
Note that turtle graphics are more of an educational tool than a serious way to do graphics. If you don't have a specific reason to use turtle, consider switching to other graphics libraries.
you can use screen.tracer(n) where a bigger n value means a faster drawing speed but less details
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With