Jul-24-2020, 02:54 PM
First off, please edit your post, select the code part and click the python code button (blue/yellow snakes) to format it properly.
For your question, you can adjust the speed of the ball and hence, its timing by changing the speed you update the screen OR by changing how far it jumps with each frame.
You can slow the update rate by adding a delay in your while loop. Try importing time and use the time.sleep() function. It's in seconds so you will want to use a small value like 0.01.
Play with your gravity variable to make the ball "move" faster although you will have to compensate for the bounce getting lower each time through.
If you need to get any more fancy with this app I suggest learning pygame or Vpython. Turtle is pretty limited.
For your question, you can adjust the speed of the ball and hence, its timing by changing the speed you update the screen OR by changing how far it jumps with each frame.
You can slow the update rate by adding a delay in your while loop. Try importing time and use the time.sleep() function. It's in seconds so you will want to use a small value like 0.01.
Play with your gravity variable to make the ball "move" faster although you will have to compensate for the bounce getting lower each time through.
If you need to get any more fancy with this app I suggest learning pygame or Vpython. Turtle is pretty limited.
"So, brave knights, if you do doubt your courage or your strength, come no further, for death awaits you all with nasty, big, pointy teeth!" - Tim the Enchanter