DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones AWS Cloud
by AWS Developer Relations
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones
AWS Cloud
by AWS Developer Relations
  1. DZone
  2. Coding
  3. Languages
  4. Introductory HTML5 + JavaScript game development: Duck Hunt

Introductory HTML5 + JavaScript game development: Duck Hunt

John Esposito user avatar by
John Esposito
·
Oct. 22, 11 · Interview
Like (0)
Save
Tweet
Share
6.28K Views

Join the DZone community and get the full member experience.

Join For Free

If you're looking for a clear, fun, and amusing introduction to game development with HTML5 and JavaScript, you might want to check out Matt Sorabian's Duck Hunt. The game is disturbingly enjoyable (complete with Matt's stream of dry canine consciousness), and the source is very clear.

Matt also includes some interesting notes on timing and callback problems:

"Another issue was ensuring that levels and waves were generated cleanly and only once. Because many things in this game depend on timers and animation callbacks there were (and likely still are) a few situations were the game could get a bit confused. One such situation was occuring if a duck was shot just as the wave timer was about to end. The chain of events would cause the (now defunct) nextWave() function to fire twice pushing you forward an extra wave, or level. Occassionally both would happen at once and things would be very hairy. "


Sometimes there's nothing more satisfying than running into subtle problems, solving them efficiently, and shooting ducks as a reward.

HTML JavaScript

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • Key Elements of Site Reliability Engineering (SRE)
  • Create Spider Chart With ReactJS
  • DevOps for Developers: Continuous Integration, GitHub Actions, and Sonar Cloud
  • How To Choose the Right Streaming Database

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends: