When you pulled the trigger, the screen flashed to all black except for where the ducks where. The ducks flashed to a white block.
The zapper had a camera in it that read the screen. They then used the positions of the white squares to determine if you hit a duck, and which one.
That is how I understand how it works.