Mega Man/Ice Man

#2
The best way to do this puzzle safely is to rush to the right corner as the enemy slides to the left side of the screen. If you back yourself into the corner far enough, the enemy will remove itself from the area once it goes off screen. If so, you won't take any damage as you try to get out of the pit. Follow the image for the easiest route.