What makes this problem hairy is that some tiles always block movement (walls), some tiles never block movement (empty, fake), and then there are tiles which
sometimes block movement (most pushable stuff). I say sometimes because boulders act like walls if they themselves are blocked.
This leads to fun stuff like the following, where you can't rotate anything until you've looked at all the tiles around the conveyor (S = solid, o = boulder, / = conveyor):
Code: Select all
ooo ooo
o/o o/o
Soo ooo
nothing everything
moves moves
I like the vector approach, though. You could do the rotation right on the board, instead of copying to another array first.