FIELD OF FLOWERS
In this mini project 6, we learn how to apply OOP and arrays to make our own particles. I decided to make a field of flowers that are also moving. Not only work moving, the audience can also interact with the flowers to change their colors. This gives a colorful sense of the work instead of being bland with one color. The background I chose is soft and not too dark or bright yellow to make the flowers color vibrant. The flowers are delicately crafted from circles that twinkle and shimmer in an exquisite display of movement.
When you press the flowers it will change colors:
REFLECTION:
Object oriented programming (OOP) is a coding method that uses the concept of “object”. It is a method to allow programmers to organize their code and structure their code with the use of objects, which are instances of classes, to represent data and behavior. The first concept of OOP is, class, it is a template for creating objects. It defines the attributes (data) and methods (functions) that objects created from the class will have. The second one is an instance. An instance is a specific version of an object with its own particular details. OOP is very useful when you want to create a lot of the same objects. You don’t need to draw the object one-by-one, but you can manipulate it by using OOP. From what we learned in mini project 5, modularity and reusability, OOP gives this advantage too. OOP allows you to organize your code into reusable, self-contained units called classes. This modularity makes it easier to manage and maintain large codebases, as you can work on individual components without affecting the entire program.
In this mini project 6, the objects that i have created are a field of moving flowers. The class is titled “PARTICLE” and inside the class there are constructor,displays and updates. In the display section, I drew how I wanted the flowers to look. Since I wanted to make the flowers blink, I replaced the diameter as “this.dia” instead of a number. This makes it easier to manipulate the code in the update section. Next, I also wanted the flowers to move to left and right, instead of having a fixed number for the x coordinate, I use this.x and this.speedx. I also added an interaction, where you can change the color of the flowers when your mouse is pressed. In this case, instead of having a number for the color arguments, I replace it with this.h. And in the update function, this.h=random(100) this means that the color value will randomly change from 0-100. The challenges I have in this mini project are, I couldn’t make more shapes other than shapes that are connected with the flowers. This gives me limitations to only focus on the flower.