WhacAMole is a desktop application built using Java and Swing, implementing the classic Whack-a-Mole game. Players can test their reflexes by clicking on moles as they pop up on the screen. The game features a simple graphical interface with mole images, a score tracker, and a timer, providing an engaging and fun experience.
- Displays the game board with mole holes.
- Includes a start button to begin the game.
- Moles randomly appear and disappear in the holes.
- Players click on moles to score points.
- Tracks the player's score based on successful hits.
- Features a timer to limit the game duration.
- Uses images for moles and the game background.
- Provides a visually appealing interface with Swing components.
- Frontend: Java Swing
- Language: Java
WhacAMole/
├── src/ # Source folder containing Java files
│ ├── App.java # Main application entry point
│ └── WhacAMole.java # Core game logic and Swing UI
├── monty.png # Image for the mole
├── piranha.png # Alternate image for the mole
└── .gitignore # Git ignore file
- Java Development Kit (JDK) 8 or higher
- A Java IDE (e.g., IntelliJ IDEA, Eclipse) or command-line tools
-
Clone the repository
git clone https://github.com/Preveen369/WhacAMole.git cd WhacAMole -
Compile and run the app
- Navigate to the
srcdirectory:cd src - Compile the Java files:
javac App.java WhacAMole.java
- Run the application:
java App
- Navigate to the
Alternatively, import the project into your IDE and run App.java.
Pull requests are welcome! Feel free to fork the repository and suggest improvements.
Steps to contribute:
# 1. Fork the repository
# 2. Create a feature branch
git checkout -b feature-name
# 3. Commit your changes
git commit -m "Add feature description"
# 4. Push to GitHub
git push origin feature-name
# 5. Open a Pull RequestFor queries or suggestions:
- 📩 Email: spreveen123@gmail.com
- 🌐 LinkedIn: www.linkedin.com/in/preveen-s/
If you like this project, please consider giving it a ⭐ on GitHub!