Learn creative coding writing simple programs

112. Array of objects: hypnotic animation part I

This episode is split in two parts. Our goal is to create an array of animated objects. We will create a few hundred pulsating circles.

In the first part of this episode we create two files: a very simple main program, and a class file where we define Bug, our animated circle. The size of this circle will increase and decrease regularly. Each of our bugs will have six properties: the horizontal and vertical position, the current size, the maximum and minimum size, and the "growth direction": a value that indicates how much the circle grows or shrinks on each frame. If that value is positive, it means the circle is getting bigger. If it's negative, the circle is becoming smaller. If you have a number, and add a negative number to it, the resulting number is always smaller. That's how the circle shrinks. For instance, assume the circle has size 20. If you add -1 to it, you get 19. Add -1 again and you get 18. I hope you get the idea.

Tags: array, objects

Code editor

You can make changes to the code below. Then
Below you can ask and answer questions related to this video. If your question is unrelated to the video, please post it at the Processing Forum as I'm unable to help with all of your programs and still have enough free time to eat and sleep :)
comments powered by Disqus