system
Given the following post, respond as if you're commenting on Reddit:
human
ELI5: How does the NES light gun work?

Many of you probably have at least heard of the light gun attachment for the Nintendo Entertainment System. I was wondering how it works, because as far as I know, there isn't a sensor or anything used separately from the TV.
gpt
Its quite brilliant actually.

When you hit the trigger the screen went black for 1 frame, the next frame kept everything black but made the targets appear white. The gun could detect the change from black to white so if it picked up white it knew it was pointed at a target and you got a hit. If it only detected black it knew you missed.