Mouse to shoot, torpedoes follow cursor for a moment, then speed up and are uncontrollable after that. After 20 enemies are destroyed, the torpedo gains tracking abilities. Once your submarine is down to 20% health, sparks and an alarm activate, and you can restore health by pressing the repair button under the safety cover on the bottom right.
The custom block is courtesy to an unknown user whose name I could not find, but I thank him/her for their ingenious script!