Eden

A ecosystem simulator
Overview
Eden is an ecosystem simulator that simulates the two most common entities that exist in nature, the prayer and the prey. In the system, the prayer, or the hunter, will try to hunt the prey, aka the plants, that will dupliate in  preset period for breed. The hunter will run out of life after it move to a certain distance.
Inspiration
Our nature starts with a simple phenomenon, emergence, a series of simple rules that interface with each other created unlimited possibilities. It is fun to recreate it.
The life exist in the system
Life at work
Apr 2014 - Mar 2015
As a simulation of a simplified ecosystem. Two maojor life is designed and co-existed in the system, the plant and the hunter.
Plants are growing, branching and seeding. The plants will be seeding and replicate surrounded themselves in a period.
Hunters can eat plants. If a hunter eat enough plants, it will breed a new hunter. Each move hunter take will decrease the life. If life runs out, the hunter will die and become the nutrients that grow plants.
How the system work
The ecosystem
Apr 2014 - Mar 2015
The hunter is made by five parts, it need to find the plants, move to it, consume the food, duplicate himself and die after the life runs out.
The planes is much simplier it only need to grow, duplicate itself, by the fission rate set after certain time.
How to make hunter
The code
Apr 2014 - Mar 2015
Find the food
I use a bubble sorting algo to calculate the distance between the hunter and the food around it, and choose the plant that closest to the hunter.
Eat the food
After find the food, the hunter will by to it by using radian to deteremind to target vector, after the position of the hunter and the food is overlayed, the hunter will count to eat one more food and the plant dissapered by the killerhandle which can detele items in the entities list.
Fission
After reaches certain amount of food ate, the hunter will trigger a signal to construct another hunter.
Die
After reaches the time set for the life, the hunter will trigger a signal to allow killerHandle kill itself.
How to make plant
The code
Apr 2014 - Mar 2015
The plant is made by a randomizer that can generate itself around itself to simulate the seeding procedure of plant in nature
The grow function calculate the time that the plant exist. After reaches certain amont of time reaches zero, the constructor will be trigged and constructed preset amount of plants.
The constructor
The code
Apr 2014 - Mar 2015
The constructor controlls the metabolish in the system which keep mointering the the singal sent from both the hunter and plant entities and excuting the fission or kill function
Interaction
The code
Apr 2014 - Mar 2015
The interaction contains put plant and put hunter over the generated world.
Using left mouse to generate a new hunter.
Using right mouse to generate a new plant.