A fun and interactive browser-based Duck Hunt game built with vanilla JavaScript, HTML, and CSS.
Click on the ducks as they fly across the screen to score points!
Link: Click here to play the game
- 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
- Wait for the ducks to appear (they spawn after 2 seconds)
- Click on the ducks to shoot them down
- Each duck eliminated earns you 1 point
- Once all ducks are eliminated, a dog appears celebrating your round
- The dog leaves after 5 seconds and the next round begins with new ducks
- Try to get the highest score!
- 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!
- HTML5 - Structure and layout
- CSS3 - Styling and animations
- JavaScript (Vanilla) - Game logic and interactivity
- Web Audio API - Sound effects
- Clone or download this repository
- Open
index.htmlin any modern web browser (Chrome, Firefox, Safari, Edge, etc.) - No server or build process required - it runs entirely in the browser!
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/
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 ducksEnjoy the game! 🎯
Follow my journey and other projects on:
🧠 Je 9:23-24
