Categories
Uncategorized

processingObjective.001: movement & boundaries

Create a space, and a circular object (“ball). Program the ball to move within the space, rebounding off its boundaries when necessary.

Update: Objective complete.

Notes:

  • The x and y positions of the ball determine its RGB values: The x position determines the red value, the y position the green value, and the sum of x and y determines the blue value. Scaling was used to keep values in the range of 0 – 255, and values had to be converted from floating point to integer data types.
  • The pattern created by the ball’s movement is achieved by never redrawing the background during each frame of animation. Had the background color been declared during the draw() function, each frame would have wiped the background clean, showing only the ball’s current position — practical, but less interesting to look at.

Leave a Reply

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