slysnivy / Soup_Arcade

A repository dedicated to showcasing games, visual aides, and other projects that I have cooked up 🧑‍🍳
Apache License 2.0
1 stars 0 forks source link

Create algorithm for plant growth #7

Open slysnivy opened 10 months ago

slysnivy commented 10 months ago

The most important factor is to detect connectivity and direction. Connectivity is important when removing plant square pixels

slysnivy commented 10 months ago

I think the best way to approach this is to have a singly linked list and have classes represent different parts of a plant. For example, there would be Stem(), Branches() and Leaves() classes, where Stem() is the parent of Branches(). The Leaves() class would just be a standalone class with not much detail (it would only need growth and what it provides for the plant overall. This would all be under a Plant() class that would determine Stem, Branch, and Leaf behavior. The Stem() would be a linked list where the nodes link to other parts of a stem such as Branches() or Leaves(), meaning each node would be a list. Branches() would be another linked list to contain other parts of a branch and Leaves() (again, nodes are a list). Finally, each component of a Node will also contain a class called PlantPixels() with different colors to represent different parts of a plant. This will be the main component in the list within the Node and will just be drawn.