Skip to content

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Duck Hunt Game 🦆

A fun and interactive browser-based Duck Hunt game built with vanilla JavaScript, HTML, and CSS.

Game Preview

Click on the ducks as they fly across the screen to score points!

🔗 Live Demo

Link: Click here to play the game

🎮 Features

  • Dynamic Duck Movement - Ducks fly around the game area, bouncing off boundaries
  • Click to Shoot - Click on ducks to eliminate them and increase your score
  • Sound Effects - Satisfying audio feedback when ducks are hit and when you clear a round
  • Responsive Gameplay - Smooth 60 FPS animations
  • Dog Animation - A dog appears after you eliminate all ducks, celebrating your victory!
  • Progressive Difficulty - Multiple ducks appear in different rounds for increased challenge
  • Score Tracking - Keep track of your total score throughout the game

🕹️ How to Play

  1. Wait for the ducks to appear (they spawn after 2 seconds)
  2. Click on the ducks to shoot them down
  3. Each duck eliminated earns you 1 point
  4. Once all ducks are eliminated, a dog appears celebrating your round
  5. The dog leaves after 5 seconds and the next round begins with new ducks
  6. Try to get the highest score!

💡 Tips & Tricks

  • Ducks move faster and bounce around the screen - anticipate their movement!
  • Pay attention to which direction the duck is facing to predict where it will go
  • Multiple rounds will have varying numbers of ducks for added challenge
  • Watch for the dog celebration at the end of each round!

🛠️ Technologies Used

  • HTML5 - Structure and layout
  • CSS3 - Styling and animations
  • JavaScript (Vanilla) - Game logic and interactivity
  • Web Audio API - Sound effects

🚀 How to Run Locally

  1. Clone or download this repository
  2. Open index.html in any modern web browser (Chrome, Firefox, Safari, Edge, etc.)
  3. No server or build process required - it runs entirely in the browser!

📁 Project Structure

duck-hunt/
├── index.html              # Main HTML file
├── README.md              # This file
├── css/
│   └── style.css          # Game styling
├── js/
│   └── script.js          # Game logic
└── assets/
    ├── images/
    │   ├── duck-left.gif
    │   ├── duck-right.gif
    │   ├── dog-duck1.png
    │   ├── dog-duck2.png
    │   └── favicon.svg
    ├── sounds/
    │   ├── duck-shot.mp3  # Sound when duck is eliminated
    │   └── dog-score.mp3  # Sound when round is completed
    └── font/

⚙️ Customization

You can easily customize the game by editing the variables at the top of script.js:

let duckCount = 1                    // Number of ducks per round (1-2 recommended)
let duckWidth = 96                   // Width of duck image in pixels
let duckHeight = 93                  // Height of duck image in pixels
let duckVelocityX = 5                // Horizontal speed of ducks
let duckVelocityY = 5                // Vertical speed of ducks

Enjoy the game! 🎯

👨‍💻 Connect with Me

Follow my journey and other projects on:

LinkedIn GitHub Email Ko-fi


🧠 Je 9:23-24

About

This is a recreation of the game Duck Hunt developed using JavaScript

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages