First of all, you need to find a well-matched opponent. The stronger pirates have cannons with longer ranges, so they're harder to fight.