Rain Forest

Concept

Initially, I had an idea to create rainfall and falling shaky leaves to show the windy and rainy weather, which I greatly enjoy and which we cannot encounter in Abu Dhabi. In an attempt to create the initial idea, I discovered some new, surprising outcomes, which changed my concept but made it even better than was planned. I was able to create an animated painting, which reminds me of famous Chinese ink paintings. Now my work is very pleasing and attractive!

Approach and Code Highlight

With this work, I had to experiment a lot. Using the trial-error method, I came to the outcome I enjoy. I created two classes and two arrays, set up a beautiful subtle color palette, and made some features, e.g. rainfall and drawing of the leaves.

I am happy with how leaves are drawn in this program. I used this video to understand how classes and arrays work and saw a nice method of how to create a shaky movement. I believe this is what makes my code interesting.

shake() {
  // movement of leaves
  this.leafX = this.leafX + random(-5, 5);
  this.leafY = this.leafY + random(-5, 5);
  this.leafX1 = this.leafX1 + random(-5, 5);
  this.leafY1 = this.leafY1 + random(-5, 5);
  this.leafX2 = this.leafX2 + random(-5, 5);
  this.leafY2 = this.leafY1 + random(-5, 5);
}

Another interesting action was experimentation with transparency alpha value in the background. I noticed that setting the value closer to zero would produce semi-transparent traces, which brings some charm to my work. Specifically, the movement of the leaves leaves traces in the form of a crown of a tree, and falling drops leaves traces that look like the trunk of a tree.

Reflection and Future Thoughts

I have an issue with this code, which doesn’t crash my program and it works fine, however, I would like to understand what I did wrong and to learn how to code variables accordingly.

Nevertheless, I am proud of the outcome because it was my first time doing object-oriented programming. I now understand all the benefits of coding in classes rather than hardcoding every single point and object in my program.

Leave a Reply