Well, I’ve been working a bit more on the first a-life experiment. So far, I have some ugly scaling bitmap plants that grow over time. Some of them are overlapping the boundary of the sandbox though and I don’t want to have that, so I need to make them move away from it when they touch it. Also, future me, draw your graphics large and scale them down. I don’t know what I was thinking making little green dots and scaling them up like this…
A big problem I’ve got is that when the plant collides with the sandbox boundary, it doesn’t give me the location of the collision. It’ll give me the colliding entity, and if it was a regular entity I could extrapolate the collision based on its location and dimensions, but in this case I’m using a tilemap and it doesn’t give me the tile’s info, it gives me the TILEMAP’s coord, which is 0,0.
Oho! I have come up with an idea. It’s a bit dirty but if I make sure that, upon growth, the plant is at least 16px from the border, it won’t overlap!
… Not sure that’s a great idea.
Instead, I think I’ll just futz it, leave it as it is, and only spawn plants at least their maximum size away from the walls.
*work work work* Okay, looking good! The plants are functional, so it’s time to add the animals. To start with, I’ll be making a mobile herbivore that will eat the plants, mate, reproduce, and die of old age.
They’ll need to have a sense of some kind to tell what’s around them, what direction to go, and so on. I’m thinking I’ll give them a radial sense, since most herbivores have a wide range of vision. I might give them a sense of smell, too. Sight will give them the exact location of a thing if it’s in range, and smell will have a longer range and give them a general direction to go in.
I’ll start by making them sense food and eat it; I won’t do reproduction untill I at least have them moving around and finding food.
But, for now, it’s getting busy in the cafe, I’m getting tired, the sun is shining in my face, and I’m all done my food. I think I’m going to head home.