You could just tell it to rotate on collision with an invisible object, so it never actually touches a wall, you could set angles of 0,90,180,270 and get it to either pick one at random, but this could create a bounce action, or get it to check for invisible object is within say 2 pixles then rotate.