If the game freezes, just click inside it (games can get unresponsive if you click elsewhere on the page).
Balls are planning to sink your submarine. As they spiral towards you, you will have to fight them off by shooting similar coloured balls into the string. When you create a segment of three or more balls of the same colour, it will collapse. When you have eliminated all the balls, you will advance to the next level.