BLACK_III_desktop-1.jpg

Nature of Code

Week 4: Systems and Inheritance

This week I experimented with particle systems and inheritance to develop a rain cloud system.  First I practiced making one particle system with particle lifespans (Figure 1).

I then added multiple particle system instances inside a particle system class (Figure 2).

Figure 2

This example can be found here and the code can be found here. I then began to make the rain/cloud sketch.  I started by making a generic particle class.  I then made a raindrop class that extended the particle and changed its appearance and motion to look more like rain (Figure 3).

Figure 3

Again, I created a cloud particle class that extended the generic particle class.  I then made two systems, one for rain and one for the cloud.  In the main draw loop, 10 systems of each type are made and display on the screen to make a rainy weather landscape. This example can be found here and the code can be found hereFigure 4 shows the final result. 

Eva Philips