I know that eating candy gives HP, but I'm not sure how much I need to eat in order to beat the Castle Entrance. I've eaten about 14k and have a flame sword and can't get close to the entrace even if i use 5 health potions.
It's not so much health that's the problem (even though having high health is important) but getting through the soldiers before you get teleported back to the beginning. I've eaten 31254 candies and I can survive long enough, but I can't get through because I don't kill the soldiers and guards fast enough.
So, first of all, you should be able to have the heart plug. If you don't, then let me tell you how to get it. So first, you go into the Cave Entrance. Then you just randomly pick directions until you see arrows on the walls. Then you follow the directions of the arrows and then click the weird thing on the ground. Bam. So now you can cheat, get the current game as text, locate the line: number gameCandiesEatenCurrent=X. Then you can type in 99999 and then it should show up as number gameCandiesEatenCurrent=99999. Ta-da, you have 1200 health and you are READY!
Candies don't matter here, as it doesn't matter how long you can survive, if you can't deal enough damage to get further and further each time.
But, Candy is useful as it gives you more time to focus on scrolls instead of Health potions.
I won without a Berserk Potion by rapidly casting Earthquake scrolls. But I got better results with just saving my Fire Blasts for Knights.
If you have enough Fire Blasts, I'd say, use them on Knights and the guards that come out of the castle, or everything, if you have that many.
Flame Sword is best, but I assume it can be done with any sword type.