Indeed, that's interesting, and also quite feasible.
The way I'd do it is to make a "
waiting to move"
list, and fill it up with every entity at the begin of each step.
Then, I go into an infinite loop while entities are on the list, and for each one I simply perform my normal TryMove(x,y) script.
This script I would modify to, if GetBump()/GetKill() fail, to see if the target entity is on that list, and if so, do not remove itself from the list and carry on with the rest.
However:
This would only affect direct entity-to-entity bumps, but not entity-to-related-item bumps.
Consider:
# @-S
O- #R
#
S = Sworded character
R = Roach
# = Yellow door
@ = orb
If the S would move before the roach, the roach could pass.
If not, it couldn't.
The only way to pass this would be either to:
1) Perform complex checks to see if such situation are possible. (Bad idea)
2) Bring in a second list, this time containing entities that tried to move already but
failed. Then if an entity, by moving, activates a certain item (like an orb), all of these would be re-added to the list.
So I consider just sticking to bumps. (Thus giving the illusion that entities will move away for them, if they have room).
Another movement-order affected situation:
O- R-S
This time, R dies only if S moves first, but not the other way around. (Since it technically isn't a denied Bump, it's an approved Kill, resulting in suicide of the roach)
-Insane