nature-of-code / noc-examples-processing

Repository for example code from The Nature of Code book
MIT License
2.55k stars 953 forks source link

Fixed dragging pendulum #86

Closed ghost closed 7 years ago

ghost commented 7 years ago

Hi Dan!

I noticed on "The Nature of Code" website, that if you click anywhere on the "Example 3.10: Swinging pendulum" window, the pendulum will lose its speed, because of setting aVelocity to 0 in stopDragging() function. So I just added if (dragging), which fixes this problem :)

Thank you for the book and YouTube channel (I'm making this pull request thanks to your "Git and GitHub for Poets" tutorial), cheers!

shiffman commented 7 years ago

Oh, thank you for catching this, what a great bug fix!!!

ghost commented 7 years ago

You're welcome, thank you for the great work once more!