SA-2, due Apr 3
Use a set of blobs to make an animated Jackson Pollock-esque painting; i.e., random streaks/patches of moving colors. The screenshot is static, but it is being dynamically altered by a bunch of blobs.
Exercises
You can do this by starting with the PaintedImage
from class, stripping out the input image, and using random colors instead. If you'd like, you can start with template code in which I've done the stripping-out part: Pollock.java. I'm just using wanderers and painting black everywhere, so you'll need to make them keep different random colors, and then transfer those colors to the result
image.
- To generate a random color, call
new Color(v)
wherev
is a number between 0 and 16777216 (ask me next class where that number comes from). - To be able to transfer the color for one of your blobs, you'll need to store the color in an instance variable and then retrieve it later.
WanderingPixel
allows you to store it, but you'll need to augment the class to allow retrieving it. Or you could use a differentBlob
subclass for a different style of painting (e.g.,Bouncer
for lines, or your SA-1PurposefulWanderer
for streaks), and then need to augment that class appropriately. - Note that the
Pollock
class has a list ofBlob
s. Will your code work on any old blob? If not, change the declarations accordingly (e.g., store a list ofArrayList<WanderingPixel>
, get aWanderingPixel
from the list, etc.).
Submission Instructions
Turn in your completed Java code and a snapshot of a masterpiece drawn by your blobs.