I died doing that because I was moving so slow
Use the Ice Wand—you can get it from an Ice Slime—and try to avoid staying in the middle when facing the boss.