The time spent operating your mining machinery costs money. Collect extra gold to repair/improve your pipes, but you only have to get all the diamonds to complete the level.
Collect boulders when they appear and press CTRL to drop them in the path of oncoming monsters. Boulders can block important passages, letting you operate more effectively.