Well without knowing exactly what your code is I can't say for sure what's wrong. I suggest you make the place the boulder must be moved on a place that the boulder can only be pushed to from a certain square and couldn't be pushed any other way once there (a short 1 square wide pathway).