I made a multiplayer connect four game using the Pycharm IDE and pygame. At first, I just made a basic text game using a matrix to store all of the values of the connect 4 grid. After that worked, I used the pygame module to add color and make my game seem more realistic looking. I defined multiple functions for drawing the game board, the game pieces, and the placement of each of the game pieces. After the two player game worked, I used tensorflow to create an AI that you could play against. I started with all the possibilities that the piece could move to and then used a data set to train the AI to take all of the moves that it would need to win and block its opponent.
Code:
Output:
Video of game in action: