The bee diversity has declined massively over the last couple of years,
causing them to be endangered. Our planet simply can not survive without
bees and it is up to us to save them. By creating this bee natural system
I hope to bring more awareness to the extinction of bees.
In the beginning I had envisioned incorporating a bee collecting honey from a flower
and then taking the honey
back to the beehive. Although since then I have expanded on the idea and have incorporated
multiple flowers that
multiple bees will come out of the beehive to collect and bring back
to the beehive making it bigger, each time more honey is collected.
The diagram above was very helpful in helping me to understand which
functions each object would have and how they would all be
intertwined which each other.
Although through out the way I did come into some problems, but with some help
from online resources I was able to debug and create a bee catching flower for honey system.
These different formulas that helped me to do what I needed to complete
the bee natural system have been posted down below, to show and explain the complexity of it.
So, in order for me to make the bee natural system more complex I wanted to be able to add
more flowers for the bees to catch rather than a set amount. By pressing
the space bar you can add as many flowers as the user wants. I also wanted
to make it more interesting by creating multiple bees going after the flowers
and by pressing the mouse it creates multiple bees that will go and attack
the flowers.
For the future, I want to create different types of flowers that would
also give each bee a different honey count. Possibly making it an interactive
game that scores how much honey bees can collect within a certain time limit.
// adds honey when bee brings flower back
void addHoney() {
this.honeyCount++;
this.size += 0.5;}
// caculates distance from bee to flower
double distanceToFlower(Sunflower flower) {
return Math.sqrt((this.position.x - flower.position.x) * (this.position.x -
flower.position.x) + (this.position.y - flower.position.y) * (this.position.y -
flower.position.y));}
// if bee is not busy, go to closest flower and set as new target
if (flowers.size() != 0 && !busy) {
print("seeking\n");
if (target == null) {
Sunflower closest = flowers.get(0);
double closestDist = Double.MAX_VALUE;}}