Rotating around a piece in a board game

Got a board game I am working on for the heck of it, its pretty simple.

I have different colored pieces, the way you move is by clicking on one of your pieces, depending if its a right click or a let click I want all the surrounding pieces to rotate one square CW, or CCW.
Thats all dandy, but every time I start to code it I run into special cases I cant figure out for some reason, like if it is completly surrounded by pieces, none of the pieces will move because they will collide on their first attempt at updating. I would have to move them all simotaniously.

Could you use a 'before' state and an 'after' state? So if you had an array representing the board, you'd calculate each piece's new position and write it to the 'after' array. Then when you've done that for every piece, you can replace the 'before' with the 'after'. Or animate from one to the other.

maximile Wrote:Could you use a 'before' state and an 'after' state? So if you had an array representing the board, you'd calculate each piece's new position and write it to the 'after' array. Then when you've done that for every piece, you can replace the 'before' with the 'after'. Or animate from one to the other.

Or am I misunderstanding your problem?

No you understand it. Not sure why I didn't think of that at all, maybe since im playing super smash bros at the same time? Not storing it in a 2d array though, so Ill just make a destination x/y position variable, thanks.