Learning Processing: a beginner's guide to programming images, animation, and interaction. D Shiffman. Morgan Kaufmann, 2009.
https://dl.acm.org/doi/pdf/10.5555/1481360
https://processing.org/ Processing Software
My first game made in Javascript! It took much, much longer than I would like to think about to get this working correctly. The array was populating but kind of redundant, so I removed it and decided to pick another fight. I'm not getting any better at recognizing the distinction between class name, function name and object name in the code, so working out the logic for creating the golf-balls was interesting. I couldn't get the collision tests to work, and spent several hours trying to convert the PShape into an object, moving it into a class, changing the variables, etc- and eventually trying a singular ellipse in its place. After all of that... I gave up and deleted the collision test. Research showed there was a way with the function .getVector, but it's complex and I was lacking the will. Using nested if( ) statements I was able to keep my awesome PShape group, and check for overlap! If the golf-ball was within it would increment the score and reset the golf-ball. Otherwise a "missed" alert will appear and the game will continue. However, now that I've done that- the golf-balls only come one at a time... A problem for another day! The game and score can be reset with a click.