Not quite sure how attacking works, but interesting game.
If you can't deal with the attack in time—or if you can't hit the boss—try exiting from inside it and attacking again.