Welcome to the Connect 4 project in Java! This project is a Connect 4 game that can be played against a computer or a friend online (only on the same network).
- Play solo: Challenge the computer in a single-player mode.
- Play with a friend: Connect and play against your friend online.
- Game configuration: Customize game settings such as board size, total game time per player, time per round, and the first player to start.
- Error handling and edge case management: Robust handling of errors and edge cases to ensure a smooth gameplay experience.
- Java JDK 21 must be installed and configured on your machine.
- Apache Maven must be installed and configured.
-
Clone the repository
Clone the repository to your local machine using the following command:
git clone <repository-url> cd <project-directory-name>
-
Build the project with Maven
Navigate to the project directory and use Maven to build the project:
mvn clean install
-
Run the project
To run the project, use the following command:
mvn javafx:run
- Launch the game.
- Enter your player name.
- Choose one of the following three options:
- Play against computer
- Play with a friend
- Join a game
- Configure the game:
- Board size
- Total game time per player (in minutes)
- Time per round (in seconds)
- First player to start
- The game will start immediately after the configuration.
- Configure the game:
- Board size
- Total game time per player (in minutes)
- Time per round (in seconds)
- First player to start
- The application will provide an IP address and a port number.
- Share this information with your friend so they can connect to the same game server.
- Enter the IP address and port number provided by your friend.
- Join the game and start playing!
- Java: Main programming language.
- JavaFX: For the graphical user interface.
- Java Sockets: For network communication in multiplayer mode.
- JUnit + Mockito: For unit testing.
- xerox0213 (myself)