In a
Nature Of Code chapter, I came across an exercise to build an Ecosystem project.
I got interested in the creatures there and here I depict them with whatever I
have learnt till now.
The way the creatures behave is that as soon as you bring the mouse in the screen
area, they flock to it. If the pointer is out of the area, then the creatures run
off to random directions.
The Creatures simulated here:
This is the backbone of all creatures.
A basic rectangle which tries to reach it's target. The red dot denotes it's
head. If the target is reached, the red turns off.
This creature moves like an earthworm(?).
To move forward, it elongates it's body and then contracts.
Think dragonfly!
Has wings, which oscillate to and fro to give the illusion of flapping wings.
Worms with snake like movement.
Sine wave to the rescue!
4 legged bugs with turtle like movement.
Again Sine/Cosine wave to the rescue to move the legs.
A Fish. Again Sine/Cosine wave to the rescue to move the body.
This was added to have the fish in Electronic Life.