If this is a programming question, then yes. You should be able to program a way to 'push' a mushroom from a corner. Check for the specific conditions and whatever trigger you wish to use to push a mushroom away from a corner and have it move to what I would believe to be the only possible location away from the corner.