ABOUT
This project, called Rectangle World, is a simple evolution simulator. In this world live two kinds of creatures: plants and bugs. Plants aren't subject to evolution, they are only the first link in the trophic chain. Bugs are more interesting, they have two purposes: eat when hungry, and mate when full. Bugs have four features (inherited from their parents): speed, size, senses, and aggression.
Being a fast bug has obvious earnings but it is associated with shorter life and greater energy loss when in move. Bigger bugs have an advantage because smaller bugs run away from bigger ones (when the difference is significant). Size is associated with a greater energy cost of moving and reproducing. When a bug is big and fast its movement energy loss grows exponentially. Bug with sharp senses has a bigger field of view, which helps to find a treat or lover. However, better senses involve higher energy loss and more often notice a bigger bug, which forces fleeing. Aggression indicates how often a bug shares food when eating with another bug (there is space only for two bugs near one plant). If two bugs choose to share food, each gets half of the plant. If one critter chooses not to share, this bug gets all the food and another one gets nothing. If two bugs choose not to share, no one gets any food. However, critters remember who didn't share with them and in the future, they are not so willing to share with this individual. The features of a bug determine its appearance.
To reproduce, bugs have to find another critter, who also wants to mate and is representative of the same species. Children inherit features after their parents with some inaccuracy. With passing generations in this small world new species arise.
Some parameters of the world can be set in the settings.
In this project was used: vanilla JS (with object oriented programming), HTML, CSS, canvas.
KEYBOARD SHORTCUTS:
"m" - show/hide info bar
space bar - pause/unpause
forward arrow - speed up time
back arrow - slow down time
SETTINGS
START GENES
speed (0.3-3)
size (0.3-3)
senses (0.3-3)
aggression (0-2)