- Code editor
- No message yet.
Welcome to Terrarium.js
In your terrarium, plants, herbivores and carnivores co-exist.
Herbivores can eat plants and carnivores can eat anything but plants.
An animal can see around it, move, attack, defend, eat and reproduce. The animal can do multiple types of action in the same turn: it can eat while moving and attacking for example.
An animal can see more or less far based on its PercentOfMaximumEyeSightRadius value.
Seeing allows it to find preys and predators.
You cannot eat a living animal unless it is a plan.
An animal can only attack other animals that are within one cell from them.
The damage they cause is based on their radius: the bigger the stronger.
An animal can only defend against one attacker. Defending allows you to reduce the damage caused by an attacker.
In order for an animal to reproduce, it needs to reach mature size, have enough energy and gone through the reproduction wait time (An animal can't just feed and reproduce in loop).
Most actions (attacking, moving, defending or reproducing) consume energy.
Energy goes down as time passes too.
If the energy level reaches zero, the animal dies.
To recover energy, an animal has to eat.
Communication between animals
Animals can communicate using their two antennas. Each antenna can have 10 different positions.
In order to debug your animal's artificial intelligence, you can use your normal internet browser dev tools. Additionally, you can use WriteTrace to show messages:
this.WriteTrace("I can see an enemy");