One solution is to remove the solid behavior completely and do your collision detection yourself. An array can be useful for this since its grid based. Then you fill the array with wherever the objects are. The trick is when you move an object to update its position in the array to the goal position so it’s old position is free for other objects to move onto.
The setup of the array could look like this:
Start of layout:
— Array: set size to (layoutWidth/32, layoutHeight/32, 1)
——array: for each xy
—— compare tile at(array.curx,array.cury)=-1
———array: set (array.curx,array.cury) to 1
—— for each fmotion
———array: set (fmotion.x/32,fmotion.y/32) to 1
Then before simulating moving left for instance, you’d check if that spot was free, and if it was simulate the key press and update the array.
Array at (fmotion.x/32-1, fmotion.y/32) =0
— fmotion: simulate left pressed
— array: set (fmotion.x/32, fmotion.y/32) to 0
— array: set (fmotion.x/32-1, fmotion.y/32) to 1
It would be very similar for the other three directions. You’d use that with the for each ordered logic you already have.
That’s at least one idea. There may be clever ways to make it simpler. The issue with the solid behavior is it doesn’t know how to handle moving objects.