Received the following from Clinton:
I was asked one day, "How do you make a robot do two things at once"? It sounds like something that should be simple, but it really isn't. Even if you can get two or three things to work together in your program, trying to add more typically breaks your code and is a nightmare to debug.
In 1986, roboticists at MIT were having the same problem, and they came up with a technique that is sometimes called behaviour-based robotics. It allows you to create a bunch of simple behaviours for your robot to exhibit, and to determine when a given behaviour has control of the robot. For example, a robot may have a basic behaviour of wandering around a room, and a higher-priority behaviour of backing up and turning when it bumps into something. The beauty of the system is that each individual behaviour is fairly simple, can be debugged, and you can build up your program, in a modular fashion, from something simple to something complex and nuanced.
I have created a 45-minute-long video tutorial that discusses what behaviour-based programming is, how to use these techniques in NXT-G, and how to test and debug the robot as the program iteratively becomes more complex.