Duck Hunt in HTML5 and JavaScript

If you have pleasant memories of blasting ducks on your NES, then a new version of “Duck Hunt” on the Web will allow you to relive your youth using modern Web standards.

The game was created by Matt Surabian, a Web developer and IT administrator based in Massachusetts. He built this version of “Duck Hunt” using just HTML5 and JavaScript instead of Flash.

Duck Hunt JS

The results are really quite impressive. The animation is really quite fluid, even better than anything I’ve ever seen in Flash.

The best part of the game is the sound effects. Instead of the classic NES sounds you know and love, there is a male voice (presumable Surabian’s) instead. When the dog sniffs along the ground, he says “Bark!” followed by “Hey! There’s ducks over there!” When you shoot one of the ducks, you hear “thud” when they hit the ground, and if you miss any the dog actually laughs at you.

If that’s not enough, you can completely customize the game with the Level Creator. You can choose how many waves in each level, how many ducks to start with, how many bullets you have, how long each wave lasts, and the difficulty. There’s a warning that extreme settings may crash the browser, but I experimented with it a little bit and that never happened.

“I built this project to experiment with creating games in JavaScript,” Surabian said on the page explaining the project. The game took about 20 hours and around 500 lines of JavaScript to complete. For the developers reading this, he used the jQuery and Spritely libraries to build it.

One drawback to the game is that, according to Surabian, it doesn’t work very well on the iPad.

This is a very cool game nonetheless. It’s based on open Web standards instead of the proprietary Flash, so if more developers build games this way, developers won’t be at the mercy of companies like Apple or Adobe and can build the games they want, their way without having to worry about having the rug pulled out from under them in the future.

If you liked this, check out our posts on a (fake) trailer for a 3-D “Duck Hunt” movie, and on video game decals, as well as a “Duck Hunt” lamp that includes the famous Nintendo orange “Zapper” gun.

 

Leave a Reply

Your email address will not be published. Required fields are marked *