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.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement