This application is a multiplayer Connect-Four game, otherwise known as “Four-in-a-Row,” built with Java.
Importance Demostrates the power and flexibilty of Java socket servers
Functions:
- Allows unlimited pairs of clients to play a game of connect-four over the same server.
- Simulates a GUI of a connect-four board
- Generates an operations file and a driver.
- Receives user input as integer corresonding to board column number
The application includes four files: a server program, a client program, and two images for the red and yellow chips. The two images are used to represent the two opponents in each pair of clients.
- Establishes connections for any number of clients and pairs opponents
- Simulates the game board logic via array
- When a player moves, board is checked for end conditions a. win, loss, and tie
- Initializes I/O stream
- Sends (and receives) text messages to(from) clients
- Establishes a connection to server socket via matching port number
- Creates the graphical use interface for game board a. The game window, grid, and user icons are initialized
- Reads mouse input and converts to game data
- Handles reply text messages to and from server
- Download as .zip and unzip in desired directory.
- Clone onto your local machine via GitHub Desktop or via the git address
What things you need to install the software and how to install them
Give examples
Tell other users how to install your project locally. Optionally, include a gif to make the process even more clear for other people. A step by step series of examples that tell you how to get a development env running
Say what the step will be
Give the example
And repeat
until finished
End with an example of getting some data out of the system or using it for a little demo
Essentially, the server handles all the math, logic, and threads of the game, and the client handles what the user sees and inputs in the game. The application allows the server to run continually, accepting an unlimited number of clients, pairing up each consecutive user. Each pair of players is assigned a red or yellow chip to mark them and set as opponents. Taking turns, each player fills a cell with his respective chip via a mouse click. One player wins when he gets four chips in a row in any direction. A tie occurs when the board array is full without any winners. After a win or tie, each player is prompted to play again.
- Deploy server on live
- Handle player quit: informing other client of quit and prompting for 'new match' or 'quit'
- Open a request on this repository
- Email me at [email protected]
- Nathan Robinson - Initial work -
This project is licensed under the MIT License - see the LICENSE.md file for details