I still hear the dog's laugh echo every time a girl rejects me, when told they are no longer serving McDonald's Breakfast, and when a vending machine will not take my only dollar bill. This is for those who still think they look badass posing with an NES Zapper.
Q. Why no sound?
A. I wanted to create something simple that could be added to most web pages as an Easter egg and started through some mechanism like typing in the Konami code. Plus most of the sounds overlap and are incredibly short. This would have been a mess to try to get working correctly in every browser. I'm talking to you Internet Explorer.
Q) Why does the screen flash? A) To keep original to the game. When the trigger on the NES Zapper was pulled, the screen would turn black and targets would be drawn as white. The contrast was enough for the sensor in the barrel of the Zapper to determine if a target was hit or not. (Wikipeida)
Q. Your code is bad and you should feel bad.
A. Not a question but I agree with you fully.
- Only duckhunt.min.css and duckhunt.min.js are needed with no other dependencies. Load these on the desired page.
- To start, simple execute the function "duckhunt()". This function has an optional callback sent when complete.
- If your next step is looking for a library or javscript snippet to trigger Duckhunt.js via a key sequence like the Konami code, might I suggest cheet.js. It is the most robust of any I have seen and still simple.
Demo or it didn't happen