How does a light gun work?

Remember, we used to have Dandy? The lucky ones have pistols. And all night long, the question kept me awake: “How does this gun work?”
Everything turned out to be quite simple, but I’ll hide the answer to the question so that I can not say goodbye to the cult mystery of childhood. ;-)
In the gun (which, in fact, is called Zapper) a built-in photodiode that receives light, and because of the long "muzzle" this photodiode became narrowly focused. At the moment the trigger is pulled, the entire screen flickers black for a moment, and the target sprite fills with a white rectangle. If the "muzzle" was aimed at the rectangle, the hit was counted. If there were several targets (NES supported up to 4, but this is not accurate), then the targets were highlighted in turn (winking) and the prefix calculated the hit using binary search.
As a child, it never crossed my mind that the gun does not radiate, but receives.
This is one of the simplest implementations of a light gun. Other consoles also used more complex methods, for example, taking into account the fact that the beam (in CRT TVs) illuminates only one point at a time. The prefix filled the screen with white at the moment of pressing and counted the time until the photodiode was illuminated. Thus, the direction could be calculated more accurately, and the number of targets was determined by the "radius of destruction" of the gun. This scheme, for example, was used in SNES.
The first light pistol was invented already in 1936 for the Seeburg Ray-O-Lite machine , in which there was no picture tube =). It was also necessary to aim at the ducks, as in the well-known to all Duck Hunt .
In the video of the Clay shooting gamewhere it was necessary to shoot the plates (yes, I also remember from childhood), you can notice the very rectangles.
You can read in detail, knowing English:
en.wikipedia.org/wiki/Light_gun
en.wikipedia.org/wiki/NES_Zapper
www.madsci.org/posts/archives/1999-07/932797371.Eg.r.html
ROM-images of games for the gun.
A phone with a built-in emulator and special buttons to play NES, SNES, GameBoy. And the most ardent duck fans can enjoy the flash analog of Duck Hunt on Flash .
The very same thinking to buy a real, live Dandy, the benefit of the 400