Front Panel Picture Control (pt 2)

Content
This code introduces arrays.  It creates two different arrays: the first (for the horizontal position), is a constant array of 5 elements that are hard-coded/pre-set.  The second (for the vertical position), randomly generates the five points (so different each time the code is run).  Version one of the code controls a small dot on the screen "back and forth" (via the motor).  When it intersects with one of the bigger circles, it changes their color.
Code

 This is what the Front Panel Picture Control looks like, when the code is running and the small red dot intersects one of the empty-white circles (changing it to yellow).

Code

 Here is the code that runs this interface.

Code

 A small change for "version 2" (v2) of the code: by adding this, the "falling balls" (the white circles) now "bounce" off the bottom and top of the picture control, going back and forth.  (Note: the picture control is 500 tall.)

Code

 In version 3 (v3), when they red dot intersects with the white circles, it "deletes them" (moves off screen, effectively hiding them).  Once all five have been deleted (e.g. none have a positive position anymore), the loop/animation exits.

Leave a Reply

Your email address will not be published. Required fields are marked *