Predator-Prey simulation

Started by
9 comments, last by InferiorOlive 11 years, 4 months ago
I'm not entirely certain if this is what Lorenzo was suggesting, but if you have an array indicating where everything would be after their moves on a given turn, you could populate it by looping through all of your entities and assigning movements to them. Then, after they have all decided where to move, check which areas contain two or more entities (you wouldn't need to check every tile, only ones with at least one entity) and process their actions that way (if one is a prey and the other is a predator, just kill the prey; or, if both are predators, move one of them to an adjacent empty tile, etc.).

I think that would give you your desired effect.

Inspiration from my tea:

"Never wish life were easier. Wish that you were better" -Jim Rohn

soundcloud.com/herwrathmustbedragons

This topic is closed to new replies.

Advertisement