The herbivore will be our most basic agent that will learn to live in the terrarium. A herbivore creature will thrive by consuming plants, which will give them energy to grow and reproduce. We can follow several of the same basic patterns we used building the Plant script when creating our Herbivore agent script. Open up Unity and follow this exercise to code the Herbivore agent script:
- Create a new script called CreatureAgent in the Assets/Terrarium/Scripts folder and open it in your editor of choice. Fortunately, we won't need to create a different script for each different type of agent if we generalize things into a single CreatureAgent script.
- We will cover each section of this script as we build it. Enter the ...