For I´m no programmer, I can only say it the way, I would procede.
Let´s say the game starts and the traffic light turns to green, that means, the player has 5-10 sec.s to move to the next field. After that time the player has to stay there while the orange lights are flashing for 5 sec.s which means, that the scanning process is running. During the scanning process the field the player stands on will be detected. If it´s correct, the lights turn back to green and one can continue, else the lights turn to red and game over.
Here is a small way, I would put it in computer language:
1. create random fields on the 10x4 score board
2. display to screen for the player
3. wait for start button to be pressed
4. turn traffic light to green and wait for 10 seconds.
5. flash orange light for 5 seconds and scan fields by checking the distance and angle degree (see image)
6. if player stays on a field that is allowed and didn´t finish all steps turn traffic light to green (go to 4)
6a. if player stays on the last fields and wins flash all lights and play sound
6b. else turn traffic light to red and play sad soundhttp://imageshack.us/photo/my-images/571/67ho.png/
The image shows how to identify the field by turning the ultrasonic sensor (for distance) on a servo (don´t know the english term) and by this procedere detects the field. Keep in mind, that the square field are all 30x30, so a calculation should be possible.
One way, for I´m sure there is a nicer one, would be for example:
turn servo to 1°
if ultrasonicsensor measures distance between 5cm and 25cm player is supposed to stay on field a
if ultrasonicsensor measures distance between 26cm and 50cm player is supposed to stay on field b
if ultasonicsensor measures distance between 51cm and 75cm player is supposed to stay on field c
turn servo to 5° .....