A Java-based card-matching game built using Swing and JavaFX. The game challenges players to match pairs of cards by remembering their positions.
- Interactive Gameplay: Flip cards to find pairs and match them.
- Error Counter: Tracks the number of incorrect matches.
- Restart Game: Option to restart the game at any time.
- Customizable Board: Adjustable grid size, card dimensions, and images.
- Java: Programming language.
- Swing: For GUI components and event handling.
- JavaFX: For enhanced graphical capabilities (optional).
- Maven/Gradle (optional): For dependency management.
The project is organized into the following directories:
- src: Contains the source code for the game.
- images: Stores the images used for the card faces.
- out: Contains the compiled Java classes.
-
Clone the repository:
git clone https://github.com/username/card-matching-game.git cd card-matching-game
-
Open the project in your IDE (e.g., VS Code, IntelliJ IDEA).
-
Make sure Java is installed on your machine.
To verify, run:
java -version
- Compile and run the project:
javac src/App.java
java -cp src App
- Launch the game by running the App.java file.
- The game will display a grid of cards face down.
- Click on two cards to flip them:
- If the cards match, they will remain face up.
- If they don’t match, they will flip back face down.
- The game tracks your incorrect attempts as “Errors.”
- Use the Restart Game button to start over at any time.
Here are some screenshots of the game:
- Timer: Add a timer to track the time taken to complete the game.
- High Scores: Store and display the best scores.
- Sound Effects: Add sound effects for card flips and matches.
- Themes: Include different themes and card designs.
Contributions are welcome! Please fork the repository and submit a pull request with your improvements.
This project is licensed under the MIT License. See the LICENSE file for details.