├── README.md
├── index.html
├── style.css
└── script.js
/README.md:
--------------------------------------------------------------------------------
1 | # Whack-a-Mole
2 |
3 | A state-of-the-art Whack-a-Mole game where moles pop up from random holes and the player must click them before they disappear. The game features dynamic difficulty adjustments, sound effects, and visual particle effects when moles are hit.
4 |
5 | ## How It Works
6 |
7 | - **Game Board:** A 3x3 grid represents the mole holes.
8 | - **Gameplay:** Moles pop up at random intervals with their appearance duration shortening as the game progresses, increasing the challenge.
9 | - **Scoring & Timer:** Clicking on a mole increases your score. The game lasts 30 seconds.
10 | - **Effects:** A pop sound plays when a mole appears and a hit sound along with particle effects are triggered when you click a mole.
11 |
12 | ## Files
13 |
14 | - `index.html` - Contains the HTML structure of the game.
15 | - `style.css` - Provides modern styling and smooth animations.
16 | - `script.js` - Implements the game logic including mole spawning, score tracking, dynamic difficulty, and visual/audio feedback.
17 |
18 | ## Setup
19 |
20 | 1. Clone or download the repository.
21 | 2. Place a mole image in the appropriate location or adjust the CSS (`mole.png`) as needed.
22 | 3. Ensure the sound files (`pop.mp3` and `hit.mp3`) are located in a `sounds/` folder (or update the paths in `index.html`).
23 | 4. Open `index.html` in your browser to play the game.
24 |
25 | ## Enjoy!
26 |
27 | Click the **Start Game** button to begin. Try to hit as many moles as possible before time runs out!
28 |
--------------------------------------------------------------------------------
/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |