You need to go around the walls that are approaching you as quickly as possible. You can only enter other pieces if you haven't hit the wall.