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
This was more challenging than it needed to be, and I spent far too long fighting with it before admitting it would have been better to continue with my previous project than start another from scratch. I really thought this would be easier to build on than starting a whole new idea/logic sequence.
I've figured out the nuances, but I'm right back to being unable to correctly nest an array. The color array keeps outputting black and white(there is no black or white in the array), and I really would have preferred drawing them out as a PShape for a more detailed look. I've figured out all that little syntax mistakes as I go(and after hours of trial-and-error), but I'm still struggling to understand why what I'm doing is fixing the problem. I think I might just be brain dead. So I gave up on the program and decided to flesh out my previous work instead!
The original intent for this game was just to practice a score counter, but as I usually do, I got caught up in the details and over-complicated it. I want to continue working on this; adding some diagonal movement for the golf-balls, and putting the target on a slight curve, rather than stuck on the x-axis.
I polished the code for this game, fixing some aesthetics and minor arithmetic issues. I added a counter and increment for the balls that are missed, but the increment ran continuously. I tried resetting the ball the same way the 'true' loop did, but it causes the 'Missed' text to disappear too quickly. In the interest of time I don't want to try figuring out how to add the timers yet, so I'm letting it be. I figured out the issue I was having with the dist( ) function and PShape groups, so I was able to work around that with the variable definitions. I removed the collision tests and used an if statement with a distance function to check if there was contact. The color array is coded correctly, and it did randomly generate the gp;f=ball colors, but it also changed the score/miss text color. I have no idea why so that's a problem for later.