BUBBLES
My second design was a bit more complex as I used classes to incorporate multiple objects. I wanted to create a ‘bubble effect’ and so needed to use animation. I started by creating and array to store each bubbles. I used a FOR loop to create 100 bubbles. Using a class, each bubble was given a speed, size and colour. In order to move the objects I created a function to change the coordinates by small increments using that objects speed and the xDir and yDir values. When displaying the objects I had simple function to place ellipses that created 3 layers for each bubble to give them a different outer layer colour to the middle. My draw function simply created 50 of these bubbles and repeatedly displayed and moved them using a FOR loop to iterate through the array.