Years ago, my parents put in an invisible fence to keep our family dog from running away. The dog wore a shock collar for a while in order to get used to where the boundaries of the yard were located. Within minutes of the invisible fence being installed, she’d run into the neighbor’s yard and learned her first lesson.
My dad retrieved the dog and took the shock collar off so she wouldn’t get shocked when he walked her back through the invisible fence boundary. His decision to put the collar into his pants pocket turned out to be hilarious or painful, depending upon who’s telling the story.
In the above video, witness two enterprising gamers who modified an old Sega Genesis console to deliver jolts to controller-connected shock collars every time the in-game protagonists get knocked around or virtually killed. Also notice the bottle of Jagermeister at the 12-second mark.
Here’s the technical explanation of how everything works. The page is in French, which is probably a good thing if you’re considering doing something like this but don’t speak French.