Thanks everyone for your points. So in summary, when my kingside is getting attacked I have to:
Not push my pawns in front of my king
Counter attack them if they are opposite castled or open up the center
Sometimes you have to push pawns in front of your king, either to drive pieces away or to lock pawns. But everything being equal, there's always a way to attack you. So it's essential, if you castle opposite sides, to be able to get your attack in first, even if it's just by one move, provided your threats are strong enough. So you HAVE to be able to analyse accurately or have so many pieces pointing at your opponent's king that you can't go wrong.
This is why I suggested delaying your 0-0-0 move.
White had already played 0-0, and his King was now a valid target for your K-side attack. His Q-side attack had no bite until you castled into it.
So why not just play f6 and g5, prepare a Pawn Storm on White's King, and leave your King in the center until the center becomes too hot for you... THEN castle when you need the a1-Rook.
Sounds good.