05-30-2020, 12:11 PM
I have a game in which pieces must move closer to the opponent's pieces when they move.
They move from a position possibly with enemy pieces at various distances away along any/all the different directions, to a new location with various of its own distances to enemy pieces along all the different directions. The restriction is that the closest distance at the destination must be closer than the closest distance at the origin, or if they are equal, the next closer distances are compared, up to all available distances, and if all are equal that can be matched, then the from location must run out of enemies to compare before the destination does.
I have been trying to figure out how write this, but I can't seen to find a way to do so - any recommendations for an approach to take?
Having a Line-of-sight function, or (targeted < to | from > (piece role) Direction if (between* is Empty)) function, and or a between* with a ((to | from) (site)) context instead of just (to from) context
might be part of the answer? Or maybe some way to use canmove ?
Or stacking states or dummy players pieces on sites, or ??
Or probably a simple way I am just missing.
They move from a position possibly with enemy pieces at various distances away along any/all the different directions, to a new location with various of its own distances to enemy pieces along all the different directions. The restriction is that the closest distance at the destination must be closer than the closest distance at the origin, or if they are equal, the next closer distances are compared, up to all available distances, and if all are equal that can be matched, then the from location must run out of enemies to compare before the destination does.
I have been trying to figure out how write this, but I can't seen to find a way to do so - any recommendations for an approach to take?
Having a Line-of-sight function, or (targeted < to | from > (piece role) Direction if (between* is Empty)) function, and or a between* with a ((to | from) (site)) context instead of just (to from) context
might be part of the answer? Or maybe some way to use canmove ?
Or stacking states or dummy players pieces on sites, or ??
Or probably a simple way I am just missing.