Fork me on GitHub

Terrarium.js

Javascript programming game (port of Terrarium.NET)

Connected terrariums:
Listening to channel General:

Documentation

Welcome to Terrarium.js

In your terrarium, plants, herbivores and carnivores co-exist.

Herbivores can eat plants and carnivores can eat anything but plants.

Actions

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.

Seeing

An animal can see more or less far based on its PercentOfMaximumEyeSightRadius value.

Seeing allows it to find preys and predators.

Eating

You cannot eat a living animal unless it is a plan.

Attacking

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.

Defending

An animal can only defend against one attacker. Defending allows you to reduce the damage caused by an attacker.

Reproduction

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).

Energy

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.

Debugging

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");