Welcome to the Mastermind Game ๐ฎ! This is a classic code-breaking game where you try to guess a secret sequence of colors in a limited number of attempts. It supports multiple difficulty levels, a demo mode, user sign-up, login, and high score tracking!
- Game Description
- Features
- Gameplay Instructions
- User Management
- High Score Tracking
- Technologies Used
- How to Run
Mastermind is a puzzle game where the goal is to break a secret code composed of four colored pegs. The player has 5 attempts to guess the correct code. After each guess, feedback is given as follows:
- โฌ - Correct color in the correct position
- โฌ - Correct color in the wrong position
- X - Incorrect color
You can choose between Easy or Hard levels, or try the Demo mode to learn how the game works.
- ๐ฎ Multiple Difficulty Levels: Choose between Easy and Hard levels.
- ๐ User Signup and Login: Sign up for an account and log in to play.
- ๐ High Score Tracking: View and track your best scores for each level.
- ๐ก Demo Mode: A sample round to understand the gameplay before playing.
- Sign up: Create an account with a username and password.
- Login: Login with your username and password to start playing.
- Choose Difficulty: Select a difficulty (Easy/Hard) or try the Demo mode.
- Make Guesses: In each attempt, guess a combination of colors.
- Feedback: Get feedback for each guess and try to crack the code in 5 attempts.
- Sign-up: Enter a unique username and password. If the username already exists, you'll be prompted to choose another.
- Login: Enter your username and password to start the game.
- High Score: After completing a game, your score will be saved if it's the highest for that level.
The high scores are stored in a file and associated with each user and difficulty level. You can view your high scores by entering your username.
- Java: The game is written in Java.
- File Handling: User credentials and high scores are stored in text files (
users.txtanduser_highscores.txt).
- Clone this repository to your local machine.
- Navigate to the project directory.
- Compile and run the
Main.javafile. - Play the game by following the on-screen prompts.
To compile and run:
javac Main.java
java Main